mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-24 23:41:52 +08:00
Merge pull request #19724 from ioito/automated-cherry-pick-of-#19723-upstream-release-3.11
Automated cherry pick of #19723: fix(region): avoid duplicate zone name
This commit is contained in:
@@ -356,7 +356,12 @@ func (self *SZone) syncWithCloudZone(ctx context.Context, userCred mcclient.Toke
|
||||
}
|
||||
|
||||
diff, err := db.UpdateWithLock(ctx, self, func() error {
|
||||
self.Name = extZone.GetName()
|
||||
if options.Options.EnableSyncName {
|
||||
newName, _ := db.GenerateAlterName(self, extZone.GetName())
|
||||
if len(newName) > 0 && newName != self.Name {
|
||||
self.Name = newName
|
||||
}
|
||||
}
|
||||
self.Status = extZone.GetStatus()
|
||||
|
||||
self.IsEmulated = extZone.IsEmulated()
|
||||
|
||||
Reference in New Issue
Block a user