Skip to content

Commit

Permalink
Resolve egress rules cyclic dependencies for security groups (#229)
Browse files Browse the repository at this point in the history
Issue #, if available: aws-controllers-k8s/community#2191

Description of changes:
- generates the code for resolving egress rules SG references
- updates integration tests to account for egress rules references

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
TiberiuGC authored Oct 22, 2024
1 parent 71c4318 commit 09a1b5c
Show file tree
Hide file tree
Showing 6 changed files with 305 additions and 115 deletions.
4 changes: 2 additions & 2 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2024-10-10T04:00:51Z"
build_date: "2024-10-22T13:52:25Z"
build_hash: 36c2d234498c2bc4f60773ab8df632af4067f43b
go_version: go1.23.2
version: v0.39.1
api_directory_checksum: 585098fc7c99c27ca523f83e860107d22aaa5a10
api_version: v1alpha1
aws_sdk_go_version: v1.44.93
generator_config_info:
file_checksum: cd7df4af2cf851dbae7c054c499c3c251064ab0c
file_checksum: 2c5ef491ef62c9347bcb87918f715692adf727bc
original_file_name: generator.yaml
last_modification:
reason: API generation
10 changes: 10 additions & 0 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,16 @@ resources:
path: Status.ID
skip_resource_state_validations: true
is_required: false
EgressRules.UserIDGroupPairs.VPCID:
references:
resource: VPC
path: Status.VPCID
EgressRules.UserIDGroupPairs.GroupID:
references:
resource: SecurityGroup
path: Status.ID
skip_resource_state_validations: true
is_required: false
renames:
operations:
CreateSecurityGroup:
Expand Down
10 changes: 10 additions & 0 deletions generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,16 @@ resources:
path: Status.ID
skip_resource_state_validations: true
is_required: false
EgressRules.UserIDGroupPairs.VPCID:
references:
resource: VPC
path: Status.VPCID
EgressRules.UserIDGroupPairs.GroupID:
references:
resource: SecurityGroup
path: Status.ID
skip_resource_state_validations: true
is_required: false
renames:
operations:
CreateSecurityGroup:
Expand Down
134 changes: 122 additions & 12 deletions pkg/resource/security_group/references.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions test/e2e/resources/security_group_with_sg_ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@ spec:
groupRef:
from:
name: $SECURITY_GROUP_REF_NAME
egressRules:
- fromPort: 443
toPort: 443
ipProtocol: tcp
userIDGroupPairs:
- description: test UID group pair
groupRef:
from:
name: $SECURITY_GROUP_REF_NAME
Loading

0 comments on commit 09a1b5c

Please sign in to comment.