Merge pull request #4304 from ioito/hotfix/qx-ignore-cloud-account-health-status

fix: 支持忽略cloudaccount健康检查
This commit is contained in:
yunion-ci-robot
2019-12-25 17:10:13 +08:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@@ -680,6 +680,9 @@ func (self *SCloudaccount) importSubAccount(ctx context.Context, userCred mcclie
newCloudprovider.AccessUrl = self.AccessUrl
newCloudprovider.Enabled = true
newCloudprovider.Status = api.CLOUD_PROVIDER_CONNECTED
if !options.Options.CloudaccountHealthStatusCheck {
self.HealthStatus = api.CLOUD_PROVIDER_HEALTH_NORMAL
}
newCloudprovider.HealthStatus = self.HealthStatus
newCloudprovider.Name = newName
if !self.AutoCreateProject || len(self.ProjectId) > 0 {
@@ -1390,6 +1393,9 @@ func (account *SCloudaccount) probeAccountStatus(ctx context.Context, userCred m
account.IsOnPremise = factory.IsOnPremise()
account.HasObjectStorage = factory.IsSupportObjectStorage()
account.Balance = balance
if !options.Options.CloudaccountHealthStatusCheck {
status = api.CLOUD_PROVIDER_HEALTH_NORMAL
}
account.HealthStatus = status
account.ProbeAt = timeutils.UtcNow()
account.Version = version

View File

@@ -73,7 +73,8 @@ type ComputeOptions struct {
DefaultRdsQuota int `default:"10" help:"Common RDS quota per tenant, default 10"`
DefaultCacheQuota int `default:"10" help:"Common ElasticCache quota per tenant, default 10"`
SystemAdminQuotaCheck bool `help:"Enable quota check for system admin, default False" default:"false"`
SystemAdminQuotaCheck bool `help:"Enable quota check for system admin, default False" default:"false"`
CloudaccountHealthStatusCheck bool `help:"Enable cloudaccount health status check, default True" default:"true"`
BaremetalPreparePackageUrl string `help:"Baremetal online register package"`