1
0
mirror of https://github.com/rancher/os.git synced 2025-09-24 20:09:21 +00:00

Merge pull request #1029 from joshwget/debug-flag-changes

Make rancher.debug control bootstrap Docker and turn on log
This commit is contained in:
Darren Shepherd
2016-06-17 10:51:57 -07:00
committed by GitHub

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
}