Merge pull request #3950 from swordqiu/hotfix/qj-service-config-not-working

fix: 1. service-config not support key=value pair 2.sync_purge_removed_resources not working
This commit is contained in:
Zexi Li
2019-11-27 20:51:51 +08:00
committed by GitHub
2 changed files with 14 additions and 10 deletions
+12 -8
View File
@@ -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 {
+2 -2
View File
@@ -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)