mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
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:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user