mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
fix: service config changes not effective
This commit is contained in:
@@ -40,9 +40,10 @@ func OnOptionsChange(oldO, newO interface{}) bool {
|
||||
oldOpts := oldO.(*GatewayOptions)
|
||||
newOpts := newO.(*GatewayOptions)
|
||||
|
||||
changed := false
|
||||
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
|
||||
return false
|
||||
return changed
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -158,8 +158,9 @@ func OnOptionsChange(oldO, newO interface{}) bool {
|
||||
oldOpts := oldO.(*ComputeOptions)
|
||||
newOpts := newO.(*ComputeOptions)
|
||||
|
||||
changed := false
|
||||
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
return false
|
||||
return changed
|
||||
}
|
||||
|
||||
@@ -51,9 +51,10 @@ func OnOptionsChange(oldO, newO interface{}) bool {
|
||||
oldOpts := oldO.(*SImageOptions)
|
||||
newOpts := newO.(*SImageOptions)
|
||||
|
||||
changed := false
|
||||
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
|
||||
return false
|
||||
return changed
|
||||
}
|
||||
|
||||
@@ -59,9 +59,10 @@ func OnOptionsChange(oldOptions, newOptions interface{}) bool {
|
||||
oldOpts := oldOptions.(*SKeystoneOptions)
|
||||
newOpts := newOptions.(*SKeystoneOptions)
|
||||
|
||||
changed := false
|
||||
if options.OnBaseOptionsChange(&oldOpts.BaseOptions, &newOpts.BaseOptions) {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
|
||||
return false
|
||||
return changed
|
||||
}
|
||||
|
||||
@@ -41,13 +41,15 @@ func OnOptionsChange(oldO, newO interface{}) bool {
|
||||
oldOpts := oldO.(*NotifyOption)
|
||||
newOpts := newO.(*NotifyOption)
|
||||
|
||||
changed := false
|
||||
|
||||
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
|
||||
if oldOpts.SocketFileDir != newOpts.SocketFileDir {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
|
||||
return false
|
||||
return changed
|
||||
}
|
||||
|
||||
@@ -36,9 +36,10 @@ func OnOptionsChange(oldO, newO interface{}) bool {
|
||||
oldOpts := oldO.(*WebConsoleOptions)
|
||||
newOpts := newO.(*WebConsoleOptions)
|
||||
|
||||
changed := false
|
||||
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
|
||||
return true
|
||||
changed = true
|
||||
}
|
||||
|
||||
return false
|
||||
return changed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user