Commit 1d88d6e
authored
Add support for Security Group Adoption (#165)
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.1 parent 3ac4413 commit 1d88d6e
File tree
3 files changed
+13
-4
lines changed- apis/v1alpha1
- pkg/resource/security_group
- templates/hooks/security_group
3 files changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
3 | 7 | | |
4 | 8 | | |
| |||
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
11 | | - | |
| 15 | + | |
0 commit comments