diff --git a/pkg/compute/models/cloudaccounts.go b/pkg/compute/models/cloudaccounts.go index 60135f902e..e3f0e60ae5 100644 --- a/pkg/compute/models/cloudaccounts.go +++ b/pkg/compute/models/cloudaccounts.go @@ -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 { @@ -1387,6 +1390,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 diff --git a/pkg/compute/options/options.go b/pkg/compute/options/options.go index 8f0f97ef88..6802060ae9 100644 --- a/pkg/compute/options/options.go +++ b/pkg/compute/options/options.go @@ -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"`