1
0
mirror of https://github.com/rancher/os.git synced 2025-09-25 20:52:58 +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,7 +91,10 @@ func applyDebugFlags(rawCfg map[interface{}]interface{}) map[interface{}]interfa
return rawCfg return rawCfg
} }
if cfg.Rancher.Debug { if !cfg.Rancher.Debug {
return rawCfg
}
log.SetLevel(log.DebugLevel) log.SetLevel(log.DebugLevel)
if !util.Contains(cfg.Rancher.Docker.Args, "-D") { if !util.Contains(cfg.Rancher.Docker.Args, "-D") {
cfg.Rancher.Docker.Args = append(cfg.Rancher.Docker.Args, "-D") cfg.Rancher.Docker.Args = append(cfg.Rancher.Docker.Args, "-D")
@@ -99,10 +102,15 @@ func applyDebugFlags(rawCfg map[interface{}]interface{}) map[interface{}]interfa
if !util.Contains(cfg.Rancher.SystemDocker.Args, "-D") { if !util.Contains(cfg.Rancher.SystemDocker.Args, "-D") {
cfg.Rancher.SystemDocker.Args = append(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.docker.args", rawCfg, cfg.Rancher.Docker.Args)
_, rawCfg = getOrSetVal("rancher.system_docker.args", rawCfg, cfg.Rancher.SystemDocker.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 return rawCfg
} }