mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: service config changes not effective
This commit is contained in:
@@ -16,6 +16,8 @@ package consts
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/log"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -60,6 +62,7 @@ func GetTenantCacheExpireSeconds() time.Duration {
|
||||
}
|
||||
|
||||
func SetNonDefaultDomainProjects(val bool) {
|
||||
log.Infof("set non_default_domain_projects to %v", val)
|
||||
nonDefaultDomainProjects = val
|
||||
}
|
||||
|
||||
|
||||
@@ -22,30 +22,35 @@ func OnBaseOptionsChange(oOpts, nOpts interface{}) bool {
|
||||
oldOpts := oOpts.(*BaseOptions)
|
||||
newOpts := nOpts.(*BaseOptions)
|
||||
|
||||
changed := false
|
||||
if oldOpts.RequestWorkerCount != newOpts.RequestWorkerCount {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
if oldOpts.TimeZone != newOpts.TimeZone {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
if oldOpts.EnableRbac != newOpts.EnableRbac {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
if oldOpts.NonDefaultDomainProjects != newOpts.NonDefaultDomainProjects {
|
||||
consts.SetNonDefaultDomainProjects(newOpts.NonDefaultDomainProjects)
|
||||
changed = true
|
||||
}
|
||||
if oldOpts.DomainizedNamespace != newOpts.DomainizedNamespace {
|
||||
consts.SetDomainizedNamespace(newOpts.DomainizedNamespace)
|
||||
changed = true
|
||||
}
|
||||
return false
|
||||
return changed
|
||||
}
|
||||
|
||||
func OnCommonOptionsChange(oOpts, nOpts interface{}) bool {
|
||||
oldOpts := oOpts.(*CommonOptions)
|
||||
newOpts := nOpts.(*CommonOptions)
|
||||
|
||||
changed := false
|
||||
if OnBaseOptionsChange(&oldOpts.BaseOptions, &newOpts.BaseOptions) {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
return false
|
||||
|
||||
return changed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user