Skip to content

Commit 3a3f1fd

Browse files
committed
report error if security group not exist
1 parent b552959 commit 3a3f1fd

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)