From fa98165862bf3b49f58e5c06e8d3c0438fc8dce6 Mon Sep 17 00:00:00 2001 From: Wang Long Date: Sat, 23 Apr 2016 11:40:25 +0800 Subject: [PATCH] Remove `-D` when we set rancher.debug=false when we set rancher.debug to true, the current code also set `-D` flag to system-docker and user-docker daemon. and then we change rancher.debug to false, the `-D` flag is also exist by using command `sudo ros config get rancher.docker`. this patch fix it. Signed-off-by: Wang Long --- config/disk.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/disk.go b/config/disk.go index 0387bf07..a9015ecd 100644 --- a/config/disk.go +++ b/config/disk.go @@ -61,6 +61,13 @@ func LoadConfig() (*CloudConfig, error) { if !util.Contains(cfg.Rancher.SystemDocker.Args, "-D") { cfg.Rancher.SystemDocker.Args = append(cfg.Rancher.SystemDocker.Args, "-D") } + } else { + if util.Contains(cfg.Rancher.Docker.Args, "-D") { + cfg.Rancher.Docker.Args = util.FilterStrings(cfg.Rancher.Docker.Args, func(x string) bool { return x != "-D" }) + } + if util.Contains(cfg.Rancher.SystemDocker.Args, "-D") { + cfg.Rancher.SystemDocker.Args = util.FilterStrings(cfg.Rancher.SystemDocker.Args, func(x string) bool { return x != "-D" }) + } } return cfg, nil