mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-31 01:35:56 +08:00
ProviderFactory add method IsMultiTenant
This commit is contained in:
@@ -194,6 +194,7 @@ type ICloudProviderFactory interface {
|
||||
|
||||
IsPublicCloud() bool
|
||||
IsOnPremise() bool
|
||||
IsMultiTenant() bool
|
||||
IsSupportPrepaidResources() bool
|
||||
NeedSyncSkuFromCloud() bool
|
||||
|
||||
@@ -628,6 +629,10 @@ func (factory *baseProviderFactory) IsOnPremise() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (factory *baseProviderFactory) IsMultiTenant() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (factory *baseProviderFactory) IsCloudeventRegional() bool {
|
||||
return false
|
||||
}
|
||||
@@ -766,6 +771,10 @@ func (factory *SPremiseBaseProviderFactory) IsOnPremise() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (factory *SPremiseBaseProviderFactory) IsMultiTenant() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (factory *SPremiseBaseProviderFactory) NeedSyncSkuFromCloud() bool {
|
||||
return false
|
||||
}
|
||||
@@ -774,6 +783,10 @@ type SPublicCloudBaseProviderFactory struct {
|
||||
baseProviderFactory
|
||||
}
|
||||
|
||||
func (factory *SPublicCloudBaseProviderFactory) IsMultiTenant() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (factory *SPublicCloudBaseProviderFactory) IsPublicCloud() bool {
|
||||
return true
|
||||
}
|
||||
@@ -790,6 +803,10 @@ type SPrivateCloudBaseProviderFactory struct {
|
||||
baseProviderFactory
|
||||
}
|
||||
|
||||
func (factory *SPrivateCloudBaseProviderFactory) IsMultiTenant() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (factory *SPrivateCloudBaseProviderFactory) IsPublicCloud() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ func (self *SCloudregion) syncWithCloudRegion(ctx context.Context, userCred mccl
|
||||
|
||||
self.IsEmulated = cloudRegion.IsEmulated()
|
||||
|
||||
if !factory.IsPublicCloud() && !factory.IsOnPremise() {
|
||||
if !factory.IsPublicCloud() && !factory.IsOnPremise() && !factory.IsMultiTenant() {
|
||||
self.ManagerId = provider.Id
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@ func (self *SApsaraProviderFactory) GetName() string {
|
||||
return apsara.CLOUD_PROVIDER_APSARA_CN
|
||||
}
|
||||
|
||||
func (self *SApsaraProviderFactory) IsMultiTenant() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (self *SApsaraProviderFactory) ValidateCreateCloudaccountData(ctx context.Context, userCred mcclient.TokenCredential, input cloudprovider.SCloudaccountCredential) (cloudprovider.SCloudaccount, error) {
|
||||
output := cloudprovider.SCloudaccount{}
|
||||
if len(input.AccessKeyId) == 0 {
|
||||
|
||||
@@ -181,6 +181,10 @@ func (self *SHuaweiCloudStackProviderFactory) GetClientRC(info cloudprovider.SPr
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (self *SHuaweiCloudStackProviderFactory) IsMultiTenant() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
factory := SHuaweiCloudStackProviderFactory{}
|
||||
cloudprovider.RegisterFactory(&factory)
|
||||
|
||||
Reference in New Issue
Block a user