-
Notifications
You must be signed in to change notification settings - Fork 55
Add support for Security Group Adoption #165
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 @pcolazurdo. 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. |
/ok-to-test |
|
||
// Needed because SecurityGroups Name are held in GroupName property of the AWS resource | ||
ko.Spec.Name = resp.SecurityGroups[0].GroupName | ||
|
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.
You also need to add generated file in this PR.
This seems to be a good approach to handle adoptedResource
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.
Please let me know if you plan to make this change.
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.
Sorry, I was sick, new version with generated files should be in
6292dd2
to
9964ead
Compare
/retest |
@nnbu - I rebased against the latest release. Changes seem to be ready for merge |
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.
Thank you @pcolazurdo
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a-hilaly, nnbu, pcolazurdo 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 |
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
Issue #, if available: aws-controllers-k8s/community#1946 Description of changes: The existing logic doesn't allow for adoption of existing SecurityGroups because spec.Name is a required property for creation but the aws SDK returns GroupName. The deepCopy in sdkFind then is not enough because of the different names. By copying SecurityGroup GroupName into spec.Name as part of the sdk_read_many_post_set_output we solve this issue. This fix allows adoption of existing security groups. Tests have been successful in at least two test scenarios: adopting an existing SG and then modifying its properties, trying to adopt an invalid SG. I've also ran a few additional tests with the modified controller to be sure that existing functionality didn't break: * Create a new SG * Modify this SG * Delete this SG 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.
Issue #, if available: aws-controllers-k8s/community#1946
Description of changes:
The existing logic doesn't allow for adoption of existing SecurityGroups because spec.Name is a required property for creation but the aws SDK returns GroupName. The deepCopy in sdkFind then is not enough because of the different names.
By copying SecurityGroup GroupName into spec.Name as part of the sdk_read_many_post_set_output we solve this issue.
This fix allows adoption of existing security groups. Tests have been successful in at least two test scenarios: adopting an existing SG and then modifying its properties, trying to adopt an invalid SG.
I've also ran a few additional tests with the modified controller to be sure that existing functionality didn't break:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.