Merge pull request #14959 from swordqiu/hotfix/qj-remove-irrelevant-common-options

fix: remove irrelevant common options
This commit is contained in:
Zexi Li
2022-09-13 08:56:46 +08:00
committed by GitHub
6 changed files with 13 additions and 24 deletions
+5 -9
View File
@@ -145,10 +145,8 @@ func (h *AuthHandlers) GetRegionsResponse(ctx context.Context, w http.ResponseWr
Domains: []string{},
ReturnFullDomains: false,
Idps: []agapi.SIdp{},
SCommonConfig: agapi.SCommonConfig{
ApiServer: options.Options.ApiServer,
},
EncryptPasswd: true,
EncryptPasswd: true,
ApiServer: options.Options.ApiServer,
}
s := auth.GetAdminSession(ctx, regions[0])
@@ -195,12 +193,10 @@ func (h *AuthHandlers) GetRegionsResponse(ctx context.Context, w http.ResponseWr
// fetch this option directly from Keystone
commonCfg, err := modules.ServicesV3.GetSpecific(s, "common", "config", nil)
if err == nil && commonCfg != nil {
config := agapi.SCommonConfig{}
commonCfg.Unmarshal(&config, "config", "default")
if len(config.ApiServer) > 0 {
ret.ApiServer = config.ApiServer
apiServer, _ := commonCfg.GetString("config", "default", "api_server")
if len(apiServer) > 0 {
ret.ApiServer = apiServer
}
ret.IsForgetLoginUser = config.IsForgetLoginUser
}
return ret, nil
}
+1 -6
View File
@@ -23,11 +23,6 @@ type SIdp struct {
IsDefault bool `json:"is_default"`
}
type SCommonConfig struct {
ApiServer string `json:"api_server,allowempty"`
IsForgetLoginUser bool `json:"is_forget_login_user"`
}
type SRegionsReponse struct {
Regions []string `json:"regions,allowempty"`
Domains []string `json:"domains,allowempty"`
@@ -37,5 +32,5 @@ type SRegionsReponse struct {
EncryptPasswd bool `json:"encrypt_passwd"`
SCommonConfig
ApiServer string `json:"api_server,allowempty"`
}
-4
View File
@@ -104,7 +104,6 @@ var (
"default": []string{
"enable_quota_check",
"default_quota_value",
"enable_rbac",
"non_default_domain_projects",
"time_zone",
"domainized_namespace",
@@ -115,9 +114,6 @@ var (
"ignore_nonrunning_guests",
"platform_name",
"platform_names",
"is_forget_login_user",
"enable_organization",
"enable_tls_migration",
},
}
-3
View File
@@ -53,9 +53,6 @@ func OnBaseOptionsChange(oOpts, nOpts interface{}) bool {
if oldOpts.ApiServer != newOpts.ApiServer {
log.Debugf("api_server changed from %s to %s", oldOpts.ApiServer, newOpts.ApiServer)
}
if oldOpts.EnableTlsMigration != newOpts.EnableTlsMigration {
log.Debugf("enable_tls_migration changed from %v to %v", oldOpts.EnableTlsMigration, newOpts.EnableTlsMigration)
}
return changed
}
-2
View File
@@ -110,8 +110,6 @@ type BaseOptions struct {
PlatformName string `help:"identity name of this platform" default:"Cloudpods"`
PlatformNames map[string]string `help:"identity name of this platform by language"`
EnableTlsMigration bool `help:"Enable TLS migration" default:"false"`
}
const (
+7
View File
@@ -15,6 +15,8 @@
package options
import (
"yunion.io/x/log"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/cloudcommon/pending_delete"
"yunion.io/x/onecloud/pkg/multicloud/esxi"
@@ -189,6 +191,8 @@ type ComputeOptions struct {
EnableAwsMonitorAgent bool `help:"enable aws monitor agent" default:"true"`
EnableTlsMigration bool `help:"Enable TLS migration" default:"false"`
esxi.EsxiOptions
}
@@ -228,6 +232,9 @@ func OnOptionsChange(oldO, newO interface{}) bool {
changed = true
}
}
if oldOpts.EnableTlsMigration != newOpts.EnableTlsMigration {
log.Debugf("enable_tls_migration changed from %v to %v", oldOpts.EnableTlsMigration, newOpts.EnableTlsMigration)
}
return changed
}