From 3fc270809869b00cf5d8f80b3289da7bd4a5a3f7 Mon Sep 17 00:00:00 2001 From: Zhengyi Lai Date: Mon, 31 May 2021 11:29:28 +0800 Subject: [PATCH] Bugfix: when use admin account, the SG of other user is queried Signed-off-by: Zhengyi Lai --- pkg/executor/sg.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/executor/sg.go b/pkg/executor/sg.go index 48dc68295..1cc59dee4 100644 --- a/pkg/executor/sg.go +++ b/pkg/executor/sg.go @@ -2,6 +2,7 @@ package executor import ( "fmt" + "github.com/davecgh/go-spew/spew" "github.com/yunify/qingcloud-cloud-controller-manager/pkg/apis" "github.com/yunify/qingcloud-cloud-controller-manager/pkg/errors" @@ -143,6 +144,7 @@ func (q *QingCloudClient) ensureSecurityGroupByName(name string) (*apis.Security func (q *QingCloudClient) GetSecurityGroupByName(name string) (*apis.SecurityGroup, error) { input := &qcservice.DescribeSecurityGroupsInput{ SearchWord: &name, + Owner: &q.Config.UserID, } output, err := q.securityGroupService.DescribeSecurityGroups(input) if err != nil || *output.RetCode != 0 {