From c51150e7565c5ed88a36a0e120ca4e9448286321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Tue, 20 Feb 2024 15:43:47 +0800 Subject: [PATCH] fix(region): sync regional secgrouop (#19511) --- pkg/compute/models/secgroups.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/compute/models/secgroups.go b/pkg/compute/models/secgroups.go index a1d1af5993..c8df779b4f 100644 --- a/pkg/compute/models/secgroups.go +++ b/pkg/compute/models/secgroups.go @@ -1171,8 +1171,8 @@ func (manager *SSecurityGroupManager) ListItemExportKeys(ctx context.Context, return q, nil } -func (self *SCloudregion) GetSecgroups(vpcId string) ([]SSecurityGroup, error) { - q := SecurityGroupManager.Query().Equals("cloudregion_id", self.Id) +func (self *SCloudregion) GetSecgroups(managerId, vpcId string) ([]SSecurityGroup, error) { + q := SecurityGroupManager.Query().Equals("cloudregion_id", self.Id).Equals("manager_id", managerId) if len(vpcId) > 0 { q = q.Equals("vpc_id", vpcId) } @@ -1192,7 +1192,7 @@ func (self *SCloudregion) SyncSecgroups(ctx context.Context, userCred mcclient.T result := compare.SyncResult{} - dbSecs, err := self.GetSecgroups(vpcId) + dbSecs, err := self.GetSecgroups(provider.Id, vpcId) if err != nil { result.Error(err) return result