func LoadConfig() (*CloudConfig, error) { cfg, err := ChainCfgFuncs(NewConfig(), readFilesAndMetadata, readCmdline, amendNils) if err != nil { log.WithFields(log.Fields{"cfg": cfg, "err": err}).Error("Failed to load config") return nil, err } log.Debug("Merging cloud-config from meta-data and user-data") cfg = mergeMetadata(cfg, readMetadata()) 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") } } return cfg, nil }
func isPathToStringify(path []interface{}) bool { l := len(path) if l == 0 { return false } if sk, ok := path[l-1].(string); ok { return util.Contains(keysToStringify, sk) } return false }