Skip to content

Commit fe31a3e

Browse files
committed
fix #1990 SG leakage
1 parent 1d88d6e commit fe31a3e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/hooks/security_group/sdk_create_post_set_output.go.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55

66
// Delete the default egress rule
77
if err = rm.deleteDefaultSecurityGroupRule(ctx, &resource{ko}); err != nil {
8-
return nil, err
8+
return &resource{ko}, err
99
}
1010

1111
if err = rm.syncSGRules(ctx, &resource{ko}, nil); err != nil {
12-
return nil, err
12+
return &resource{ko}, err
1313
}
1414

1515
// A ReadOne call for SecurityGroup Rules (NOT SecurityGroups)
1616
// is made to refresh Status.Rules with the recently-updated
1717
// data from the above `sync` call
1818
if rules, err := rm.getRules(ctx, &resource{ko}); err != nil {
19-
return nil, err
19+
return &resource{ko}, err
2020
} else {
2121
ko.Status.Rules = rules
2222
}

0 commit comments

Comments
 (0)