-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support security groups with cyclic references (#213)
Issue #, if available: aws-controllers-k8s/community#2119 Description of changes: Cyclic references support is done via. the following workflow: 1. skip runtime reference state validations by setting `SecurityGroup.Rules.UserIDGroupPairs.GroupID.skip_resource_state_validations: true` (see aws-controllers-k8s/code-generator#544). This allows runtime to proceed with the `sdkCreate` call. 2. inside `sdkCreate` and `sdkUpdate` add custom logic that checks whether referenced security groups are being created on AWS end (i.e. `groupID != nil`). If the checks succeed, move forward with syncing SG rules. Otherwise, requeue and wait for all referenced SGs to be created. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information
Showing
11 changed files
with
191 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
ack_generate_info: | ||
build_date: "2024-08-29T17:15:01Z" | ||
build_date: "2024-08-29T20:21:49Z" | ||
build_hash: f8f98563404066ac3340db0a049d2e530e5c51cc | ||
go_version: go1.22.5 | ||
version: v0.38.1 | ||
api_directory_checksum: 1b53401670898ce50e6d6cc8bfba6b63ea7d5683 | ||
api_version: v1alpha1 | ||
aws_sdk_go_version: v1.44.93 | ||
generator_config_info: | ||
file_checksum: ff3f54d44dba872977fef4f23c5f766a1bebbbc2 | ||
file_checksum: b6cf44fddbe38dd354160538b750818e10bda45c | ||
original_file_name: generator.yaml | ||
last_modification: | ||
reason: API generation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
templates/hooks/security_group/sdk_delete_pre_build_request.go.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sgCpy := r.ko.DeepCopy() | ||
sgCpy.Spec.IngressRules = nil | ||
sgCpy.Spec.EgressRules = nil | ||
if err := rm.syncSGRules(ctx, &resource{ko: sgCpy}, r); err != nil { | ||
return nil, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: ec2.services.k8s.aws/v1alpha1 | ||
kind: SecurityGroup | ||
metadata: | ||
name: $SECURITY_GROUP_NAME | ||
spec: | ||
name: $SECURITY_GROUP_NAME | ||
description: test sg | ||
vpcID: $VPC_ID | ||
ingressRules: | ||
- fromPort: 443 | ||
toPort: 443 | ||
ipProtocol: tcp | ||
userIDGroupPairs: | ||
- description: test UID group pair | ||
groupRef: | ||
from: | ||
name: $SECURITY_GROUP_REF_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters