-
Notifications
You must be signed in to change notification settings - Fork 55
Fix AWS Security Group leakage at creation when an error occures #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @vflaux. Thanks for your PR. I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch @vflaux !
/ok-to-test
/test all
build_date: "2024-01-16T14:28:05Z" | ||
build_hash: 610c476ce898de19ef2552612761a0ed699fc444 | ||
go_version: go1.21.4 | ||
version: v0.28.0-14-g610c476-dirty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you make any changes to the code-generator? If needed, we'll have to merge those as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't made any changes to the code-generator. But I built it from the main branch.
pkg/resource/dhcp_options/sdk.go
Outdated
@@ -321,6 +321,7 @@ func (rm *resourceManager) sdkDelete( | |||
defer func() { | |||
exit(err) | |||
}() | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering how did we get extra new line.
return nil, err | ||
return &resource{ko}, err | ||
} | ||
|
||
if err = rm.syncSGRules(ctx, &resource{ko}, nil); err != nil { | ||
return nil, err | ||
return &resource{ko}, err | ||
} | ||
|
||
// A ReadOne call for SecurityGroup Rules (NOT SecurityGroups) | ||
// is made to refresh Status.Rules with the recently-updated | ||
// data from the above `sync` call | ||
if rules, err := rm.getRules(ctx, &resource{ko}); err != nil { | ||
return nil, err | ||
return &resource{ko}, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
/retest |
2 similar comments
/retest |
/retest |
The uni tests failures are not related to your changes. Need to tweak our prow jobs cpu/mem limit :) |
I used the main branch of code-generator without modifications to regen the code. |
/retest |
@vflaux the current "issue" with the sdk.go should be fixed in aws-controllers-k8s/code-generator#489 - please pull the latest code-gen changes and regenerate the controller. Happy to lgtm right away |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @vflaux ! can you please ship a separate PR to release ec2-controller 1.2.1? All you need is to do is to run RELEASE_VERSION=v1.2.1 ./scripts/build-controller-release.sh ec2
and ship the changes :)
/test all
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a-hilaly, vflaux The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Also, the PR is still in draft state |
/retest |
Merged PRs since last release: - aws-controllers-k8s#165 - aws-controllers-k8s#174
Merged PRs since last release: - aws-controllers-k8s#165 - aws-controllers-k8s#174
Merged PRs since last release: - aws-controllers-k8s#165 - aws-controllers-k8s#174
…-controllers-k8s#174) fix aws-controllers-k8s/community#1990 Description of changes: Change the hook `security_group/sdk_create_post_set_output.go.tpl` to always return the resource even if an error occurred. At this point the Security Group exists and we should keep track of it. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Merged PRs since last release: - aws-controllers-k8s#165 - aws-controllers-k8s#174 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
fix aws-controllers-k8s/community#1990
Description of changes:
Change the hook
security_group/sdk_create_post_set_output.go.tpl
to always return the resource even if an error occurred. At this point the Security Group exists and we should keep track of it.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.