mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): sync empty security groups (#19516)
This commit is contained in:
@@ -5904,7 +5904,7 @@ func (self *SGuest) getSecgroupsBySecgroupExternalIds(externalIds []string) ([]S
|
||||
|
||||
func (self *SGuest) SyncVMSecgroups(ctx context.Context, userCred mcclient.TokenCredential, externalIds []string) error {
|
||||
// clear secgroup if vm not support security group
|
||||
if self.GetDriver().GetMaxSecurityGroupCount() == 0 {
|
||||
if self.GetDriver().GetMaxSecurityGroupCount() == 0 || len(externalIds) == 0 {
|
||||
_, err := db.Update(self, func() error {
|
||||
self.SecgrpId = ""
|
||||
self.AdminSecgrpId = ""
|
||||
|
||||
Reference in New Issue
Block a user