Skip to content

Commit f849c94

Browse files
authored
Merge pull request #583 from jichenjc/bug/582
report error if security group not exist
2 parents b552959 + 3a3f1fd commit f849c94

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cloud/services/compute/instance.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ func getSecurityGroups(is *Service, securityGroupParams []infrav1.SecurityGroupP
326326
return nil, err
327327
}
328328

329+
if len(SGList) == 0 {
330+
return nil, fmt.Errorf("security group %s not found", sg.Name)
331+
}
332+
329333
for _, group := range SGList {
330334
if isDuplicate(sgIDs, group.ID) {
331335
continue

0 commit comments

Comments
 (0)