feat(region,keystone): add enable_tls_migration config (#13379)

This commit is contained in:
Zexi Li
2022-02-07 15:24:21 +08:00
committed by GitHub
parent 5350cf6c5b
commit 0f039e866e
4 changed files with 9 additions and 0 deletions
+1
View File
@@ -114,6 +114,7 @@ var (
"platform_names",
"is_forget_login_user",
"enable_organization",
"enable_tls_migration",
},
}
+3
View File
@@ -53,6 +53,9 @@ 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,6 +110,8 @@ 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 (
+3
View File
@@ -491,6 +491,9 @@ func (self *SGuest) PerformLiveMigrate(ctx context.Context, userCred mcclient.To
if err := self.validateMigrate(ctx, userCred, nil, input); err != nil {
return nil, err
}
if input.EnableTLS == nil {
input.EnableTLS = &options.Options.EnableTlsMigration
}
return nil, self.StartGuestLiveMigrateTask(ctx, userCred, self.Status, input.PreferHost, input.SkipCpuCheck, input.EnableTLS, "")
}