Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#583 from jichenjc/bug/582
Browse files Browse the repository at this point in the history
report error if security group not exist
  • Loading branch information
k8s-ci-robot authored Jul 13, 2020
2 parents b552959 + 3a3f1fd commit f849c94
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cloud/services/compute/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ func getSecurityGroups(is *Service, securityGroupParams []infrav1.SecurityGroupP
return nil, err
}

if len(SGList) == 0 {
return nil, fmt.Errorf("security group %s not found", sg.Name)
}

for _, group := range SGList {
if isDuplicate(sgIDs, group.ID) {
continue
Expand Down

0 comments on commit f849c94

Please sign in to comment.