Skip to content

Commit 0906f25

Browse files
committed
Update run.js
switched to if statement to not alter the default. Added a small/basic check to only accept a dns value with at least 7 characters.
1 parent 703bb36 commit 0906f25

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/run.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ module.exports = function (docker, job, provider, plugins, config, next) {
1818
env: env,
1919
}, config.branchConfig.runner.config)
2020
slaveConfig.image = slaveConfig.image || "strider/strider-docker-slave"
21-
slaveConfig.dns = (slaveConfig.dns || "").length == 0 ? ["8.8.8.8"] : slaveConfig.dns.split(",")
21+
if (slaveConfig.dns && slaveConfig.dns.length > 6) {
22+
slaveConfig.dns = slaveConfig.dns.split(",")
23+
}
2224
config.io.emit('job.status.command.comment', job._id, {
2325
comment: 'Creating docker container from ' + slaveConfig.image,
2426
plugin: 'docker',

0 commit comments

Comments
 (0)