1
0
mirror of https://github.com/rancher/os.git synced 2025-07-03 10:06:13 +00:00

Make rancher.debug control bootstrap Docker and turn on log

This commit is contained in:
Josh Curl 2016-06-17 09:41:33 -07:00
parent b6ddb4f577
commit 07cc5a430a
No known key found for this signature in database
GPG Key ID: 82B504B9BCCFA677

View File

@ -91,18 +91,26 @@ func applyDebugFlags(rawCfg map[interface{}]interface{}) map[interface{}]interfa
return rawCfg
}
if cfg.Rancher.Debug {
log.SetLevel(log.DebugLevel)
if !util.Contains(cfg.Rancher.Docker.Args, "-D") {
cfg.Rancher.Docker.Args = append(cfg.Rancher.Docker.Args, "-D")
}
if !util.Contains(cfg.Rancher.SystemDocker.Args, "-D") {
cfg.Rancher.SystemDocker.Args = append(cfg.Rancher.SystemDocker.Args, "-D")
}
if !cfg.Rancher.Debug {
return rawCfg
}
log.SetLevel(log.DebugLevel)
if !util.Contains(cfg.Rancher.Docker.Args, "-D") {
cfg.Rancher.Docker.Args = append(cfg.Rancher.Docker.Args, "-D")
}
if !util.Contains(cfg.Rancher.SystemDocker.Args, "-D") {
cfg.Rancher.SystemDocker.Args = append(cfg.Rancher.SystemDocker.Args, "-D")
}
if !util.Contains(cfg.Rancher.BootstrapDocker.Args, "-D") {
cfg.Rancher.BootstrapDocker.Args = append(cfg.Rancher.BootstrapDocker.Args, "-D")
}
_, rawCfg = getOrSetVal("rancher.docker.args", rawCfg, cfg.Rancher.Docker.Args)
_, rawCfg = getOrSetVal("rancher.system_docker.args", rawCfg, cfg.Rancher.SystemDocker.Args)
_, rawCfg = getOrSetVal("rancher.bootstrap_docker.args", rawCfg, cfg.Rancher.BootstrapDocker.Args)
_, rawCfg = getOrSetVal("rancher.log", rawCfg, true)
return rawCfg
}