mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: 允许更改私有云region名称
This commit is contained in:
@@ -396,7 +396,6 @@ func (self *SCloudregion) syncWithCloudRegion(ctx context.Context, userCred mccl
|
||||
}
|
||||
|
||||
diff, err := db.UpdateWithLock(ctx, self, func() error {
|
||||
self.Name = cloudRegion.GetName()
|
||||
self.Status = cloudRegion.GetStatus()
|
||||
self.SGeographicInfo = cloudRegion.GetGeographicInfo()
|
||||
self.Provider = cloudRegion.GetProvider()
|
||||
@@ -684,7 +683,7 @@ func (self *SCloudregion) isManaged() bool {
|
||||
}
|
||||
|
||||
func (self *SCloudregion) ValidateUpdateCondition(ctx context.Context) error {
|
||||
if len(self.ExternalId) > 0 {
|
||||
if len(self.ExternalId) > 0 && len(self.ManagerId) == 0 {
|
||||
return httperrors.NewConflictError("Cannot update external resource")
|
||||
}
|
||||
return self.SEnabledStatusStandaloneResourceBase.ValidateUpdateCondition(ctx)
|
||||
|
||||
@@ -65,7 +65,7 @@ func (region *SRegion) GetGlobalId() string {
|
||||
}
|
||||
|
||||
func (region *SRegion) IsEmulated() bool {
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
func (region *SRegion) GetProvider() string {
|
||||
|
||||
Reference in New Issue
Block a user