diff --git a/cmd/climc/shell/services.go b/cmd/climc/shell/services.go index 00a4ccd584..ee52d6c667 100644 --- a/cmd/climc/shell/services.go +++ b/cmd/climc/shell/services.go @@ -184,17 +184,21 @@ func init() { for _, c := range args.Config { json, _ := jsonutils.ParseString(c) if json != nil { - subconf := jsonutils.NewDict() - subconf.Add(json, "config") - config.Update(subconf) - continue + if _, ok := json.(*jsonutils.JSONDict); ok { + subconf := jsonutils.NewDict() + subconf.Add(json, "config") + config.Update(subconf) + continue + } } yaml, _ := jsonutils.ParseYAML(c) if yaml != nil { - subconf := jsonutils.NewDict() - subconf.Add(yaml, "config") - config.Update(subconf) - continue + if _, ok := yaml.(*jsonutils.JSONDict); ok { + subconf := jsonutils.NewDict() + subconf.Add(yaml, "config") + config.Update(subconf) + continue + } } pos := strings.IndexByte(c, '=') if pos < 0 { diff --git a/pkg/compute/service/service.go b/pkg/compute/service/service.go index ea55074d38..37efa978df 100644 --- a/pkg/compute/service/service.go +++ b/pkg/compute/service/service.go @@ -51,8 +51,6 @@ func StartService() { commonOpts.Port = opts.PortV2 } - options.InitNameSyncResources() - app_common.InitAuth(commonOpts, func() { log.Infof("Auth complete!!") }) @@ -68,6 +66,8 @@ func StartService() { log.Fatalf("[MERGE CONFIG] Fail to merge service config %s", err) } + options.InitNameSyncResources() + err = setInfluxdbRetentionPolicy() if err != nil { log.Errorf("setInfluxdbRetentionPolicy fail: %s", err)