Skip to content

feat(VPCPeeringConnection): add support for custom resource and additional fields for Modify OP and auto-accepting #158

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

Merged
merged 161 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
85b8617
feat(vpcpeeringconnection): generate code
marcdavoli Nov 22, 2023
48ded5e
Merge pull request #1 from marcdavoli/feat(vpcpeeringconnection)/gene…
marcdavoli Nov 23, 2023
4594210
fix: ignore tags in generator.yaml
marcdavoli Nov 23, 2023
65c3264
fix: Add spec field instead of ignoring tags
marcdavoli Nov 23, 2023
3a4a63a
fix: Remove spec field and tweak generator.yaml
marcdavoli Nov 23, 2023
8d856fe
fix: generate the code properly this time
marcdavoli Nov 23, 2023
105ccb8
feat: allow use of vpcRef fields
marcdavoli Nov 23, 2023
3d5e0b1
feat: add AcceptVPCPeeringRequestsFromVPCID/Refs
marcdavoli Nov 23, 2023
24593e9
feat: add PeeringConnectionOptionsRequest fields
marcdavoli Nov 23, 2023
897cc60
map sdkUpdate to ModifyVpcPeeringConnectionOptions
marcdavoli Nov 23, 2023
c4894db
feat: wire up Update op fields into payload
marcdavoli Nov 23, 2023
e2231ea
feat: add 2 more parameters to Update op payload
marcdavoli Nov 23, 2023
6504f06
chore: remove auto-accept of peering req logic
marcdavoli Nov 24, 2023
b449477
chore: 1st draft of e2e tests
marcdavoli Nov 24, 2023
40fabaa
fix: replace TagSpecifications with Tags
marcdavoli Nov 24, 2023
ec07451
chore: improve tests
marcdavoli Nov 24, 2023
759cada
fix: comment out line that will break tests
marcdavoli Nov 24, 2023
2a75419
test: run python tests without 'ref' VPC code
marcdavoli Nov 27, 2023
4b778f2
revert: add tests back with some ref fixes
marcdavoli Nov 27, 2023
1d5812e
fix: use bool instead of string in vpcpc manifest
marcdavoli Nov 27, 2023
12600c8
fix: duplicate ACK resource name for 2 diff tests
marcdavoli Nov 27, 2023
297094a
fix: comment out line that will break tests
marcdavoli Nov 27, 2023
cadbb8f
fix: use right id field + rename resource_name
marcdavoli Nov 27, 2023
345ac30
fix: more test name fixes
marcdavoli Nov 27, 2023
44f4d0a
fix: set random_suffix(max_length=40)
marcdavoli Nov 27, 2023
e6b6ac2
fix: case vpcPeeringConnectionID instead ...Id
marcdavoli Nov 27, 2023
5c33cd9
fix: cr["status"]["vpcPeeringConnectionID"]
marcdavoli Nov 27, 2023
f8c178a
chore: print out contents or cr
marcdavoli Nov 27, 2023
dcd4030
test: add more print statements
marcdavoli Nov 27, 2023
28dc1d0
test: play around with values and prints
marcdavoli Nov 27, 2023
8c1c293
fix: add try catches
marcdavoli Nov 27, 2023
ded39f8
chore: rename vpcId>vpcID & peerVpcId>peerVpcID
marcdavoli Nov 28, 2023
cdba287
revert: rename peerVpcID>peerVpcId
marcdavoli Nov 28, 2023
270dfdf
fix: add missing tag replacements
marcdavoli Nov 28, 2023
9b49874
test: peerVPCID instead of peerVpcID
marcdavoli Nov 28, 2023
e8fe1f8
chore: refactor helper assert method
marcdavoli Nov 28, 2023
7b2d6a9
fix: copy-paste typo
marcdavoli Nov 28, 2023
04a3906
chore: remove print + fix func typos
marcdavoli Nov 28, 2023
757c040
fix: ref yaml manifest
marcdavoli Nov 28, 2023
8c18167
test: add prints and fix missing tags
marcdavoli Nov 28, 2023
56f6a93
fix: remove squash copy of replacements
marcdavoli Nov 28, 2023
06247da
fix: vpcRef shape
marcdavoli Nov 28, 2023
a762939
chore: add try-catch to ref test
marcdavoli Nov 28, 2023
5264895
chore: remove prints
marcdavoli Nov 28, 2023
3a881f0
fix: try remove tags.ignore: true
marcdavoli Nov 28, 2023
19bac00
chore: ignore field_path DryRun
marcdavoli Nov 28, 2023
879ae48
chore: copy code to manipulate tags
marcdavoli Nov 29, 2023
2fcdcaa
chore: remove customUpdateVPCPeeringCon... func
marcdavoli Dec 1, 2023
5c1e2ec
chore: use update_operation.omit_unchaged_fields
marcdavoli Dec 1, 2023
fc5e9db
chore: remove unneeded hook for delta
marcdavoli Dec 1, 2023
8c4666b
test: uncomment tags.assert_ack_system_tags
marcdavoli Dec 1, 2023
b7fff4c
chore: add AcceptRequest (bool) field
marcdavoli Dec 1, 2023
5ef2799
chore: add AcceptRequest logic in sdkUpdate hook
marcdavoli Dec 1, 2023
e75dacb
fix: post merge of code-generator/pull/476
marcdavoli Dec 1, 2023
e8d6d62
fix: ignore tags in generator.yaml
marcdavoli Nov 23, 2023
d7968f1
fix: Add spec field instead of ignoring tags
marcdavoli Nov 23, 2023
267616e
fix: Remove spec field and tweak generator.yaml
marcdavoli Nov 23, 2023
3cc4fe1
fix: generate the code properly this time
marcdavoli Nov 23, 2023
c818fb1
feat: allow use of vpcRef fields
marcdavoli Nov 23, 2023
57f3247
feat: add AcceptVPCPeeringRequestsFromVPCID/Refs
marcdavoli Nov 23, 2023
751129a
feat: add PeeringConnectionOptionsRequest fields
marcdavoli Nov 23, 2023
b38de92
map sdkUpdate to ModifyVpcPeeringConnectionOptions
marcdavoli Nov 23, 2023
35de436
feat: wire up Update op fields into payload
marcdavoli Nov 23, 2023
b9daf27
feat: add 2 more parameters to Update op payload
marcdavoli Nov 23, 2023
2a580cf
chore: remove auto-accept of peering req logic
marcdavoli Nov 24, 2023
3ea113c
chore: 1st draft of e2e tests
marcdavoli Nov 24, 2023
11dfb81
fix: replace TagSpecifications with Tags
marcdavoli Nov 24, 2023
2273bcb
chore: improve tests
marcdavoli Nov 24, 2023
4f9c6e8
fix: comment out line that will break tests
marcdavoli Nov 24, 2023
700190c
test: run python tests without 'ref' VPC code
marcdavoli Nov 27, 2023
4c0237e
revert: add tests back with some ref fixes
marcdavoli Nov 27, 2023
8eba9eb
fix: use bool instead of string in vpcpc manifest
marcdavoli Nov 27, 2023
356edc3
fix: duplicate ACK resource name for 2 diff tests
marcdavoli Nov 27, 2023
1467e63
fix: comment out line that will break tests
marcdavoli Nov 27, 2023
cbe35e2
fix: use right id field + rename resource_name
marcdavoli Nov 27, 2023
7f229ff
fix: more test name fixes
marcdavoli Nov 27, 2023
e06c288
fix: set random_suffix(max_length=40)
marcdavoli Nov 27, 2023
25b747b
fix: case vpcPeeringConnectionID instead ...Id
marcdavoli Nov 27, 2023
8814b72
fix: cr["status"]["vpcPeeringConnectionID"]
marcdavoli Nov 27, 2023
2d4b385
chore: print out contents or cr
marcdavoli Nov 27, 2023
4d5dda5
test: add more print statements
marcdavoli Nov 27, 2023
f9239e3
test: play around with values and prints
marcdavoli Nov 27, 2023
a691534
fix: add try catches
marcdavoli Nov 27, 2023
e199fa0
chore: rename vpcId>vpcID & peerVpcId>peerVpcID
marcdavoli Nov 28, 2023
10c8788
revert: rename peerVpcID>peerVpcId
marcdavoli Nov 28, 2023
7c15f83
fix: add missing tag replacements
marcdavoli Nov 28, 2023
261e377
test: peerVPCID instead of peerVpcID
marcdavoli Nov 28, 2023
763ed6a
chore: refactor helper assert method
marcdavoli Nov 28, 2023
ee7e00f
fix: copy-paste typo
marcdavoli Nov 28, 2023
573e376
chore: remove print + fix func typos
marcdavoli Nov 28, 2023
713983e
fix: ref yaml manifest
marcdavoli Nov 28, 2023
4ea23d6
test: add prints and fix missing tags
marcdavoli Nov 28, 2023
7b9ee7a
fix: remove squash copy of replacements
marcdavoli Nov 28, 2023
a6c9c89
fix: vpcRef shape
marcdavoli Nov 28, 2023
a52503e
chore: add try-catch to ref test
marcdavoli Nov 28, 2023
e578a27
chore: remove prints
marcdavoli Nov 28, 2023
63d9922
fix: try remove tags.ignore: true
marcdavoli Nov 28, 2023
12e6477
chore: ignore field_path DryRun
marcdavoli Nov 28, 2023
39988ba
chore: copy code to manipulate tags
marcdavoli Nov 29, 2023
6b353d1
chore: remove customUpdateVPCPeeringCon... func
marcdavoli Dec 1, 2023
99e7a26
chore: use update_operation.omit_unchaged_fields
marcdavoli Dec 1, 2023
38ae6a3
chore: remove unneeded hook for delta
marcdavoli Dec 1, 2023
649d8cf
test: uncomment tags.assert_ack_system_tags
marcdavoli Dec 1, 2023
e004634
chore: add AcceptRequest (bool) field
marcdavoli Dec 1, 2023
2b66c6c
chore: add AcceptRequest logic in sdkUpdate hook
marcdavoli Dec 1, 2023
622ad14
fix: post merge of code-generator/pull/476
marcdavoli Dec 1, 2023
b77e731
Merge branch 'main' of https://github.com/marcdavoli/ec2-controller i…
marcdavoli Dec 1, 2023
c23a6b3
fix: code-generator fix push
marcdavoli Dec 4, 2023
2caff1b
test: add status code check for acceptRequest
marcdavoli Dec 4, 2023
dd742c6
fix: delta logic for new acceptRequest field
marcdavoli Dec 4, 2023
177f13e
test: add wait after create for 'active' check
marcdavoli Dec 4, 2023
65b1017
revert: python test wait timer
marcdavoli Dec 4, 2023
292ef31
chore: add Accept to sdkCreate hook
marcdavoli Dec 4, 2023
5c7339f
chore: add VpcPeeringConnectionRef to RouteTable
marcdavoli Dec 4, 2023
0ee68e2
chore: move accept code to after status is set
marcdavoli Dec 4, 2023
5eb98b2
test: print cr contents
marcdavoli Dec 4, 2023
d8c6506
chore: move accept code to after status is set
marcdavoli Dec 5, 2023
425bd4c
chore: remove print statements from tests
marcdavoli Dec 5, 2023
4cc5e5f
chore: remove create hook that accepts peering
marcdavoli Dec 5, 2023
cd7b39b
chore: add terminal error for illegal move
marcdavoli Dec 5, 2023
68c2c01
fix: acceptResp not found
marcdavoli Dec 5, 2023
6cf590c
fix: readd hook with explicit requeue
marcdavoli Dec 5, 2023
c9fc4f9
chore: add read_many hook
marcdavoli Dec 5, 2023
d45f9ab
fix: do a nil check
marcdavoli Dec 5, 2023
f95e77e
fix: make tests wait 1m before assert
marcdavoli Dec 5, 2023
48d826f
chore: make the Accept code more robust
marcdavoli Dec 5, 2023
c5bd091
test: increase REQUEUE_WAIT_AFTER_SECONDS to 120
marcdavoli Dec 5, 2023
24a7f77
test: use a wait function
marcdavoli Dec 5, 2023
0d5b492
test: add print output
marcdavoli Dec 5, 2023
8032a14
fix: git merge
marcdavoli Dec 5, 2023
0ad7fe9
test: invert true-false
marcdavoli Dec 5, 2023
f927281
fix: make else less restrictive
marcdavoli Dec 6, 2023
af8b8d4
test: invert true-false again, just for fun
marcdavoli Dec 6, 2023
7b82a32
chore: add debug logs
marcdavoli Dec 6, 2023
a4a5503
chore: tweak else condition
marcdavoli Dec 6, 2023
ae17780
revert: tweak else condition
marcdavoli Dec 6, 2023
85344da
test: add debug logging
marcdavoli Dec 6, 2023
9c15021
test: add debug logging
marcdavoli Dec 6, 2023
c3cdc92
test: add debug logging + use ko instead of r
marcdavoli Dec 6, 2023
ac3ae16
test: add debug logging + use ko instead of r
marcdavoli Dec 6, 2023
1ca36fa
test: gotta go fast
marcdavoli Dec 6, 2023
13b6c99
chore: requeue if isVPCPeeringConnectionCreating
marcdavoli Dec 6, 2023
93672e2
chore: use res, not r
marcdavoli Dec 6, 2023
ea4ece1
chore: add more logging to test
marcdavoli Dec 6, 2023
f1a287c
chore: add requeue after accept logic
marcdavoli Dec 6, 2023
7555073
test: change func used by wait loop
marcdavoli Dec 6, 2023
e39923c
chore: add readone right after accept logic
marcdavoli Dec 6, 2023
dbcc6d3
chore: add return after accept logic
marcdavoli Dec 6, 2023
387df36
test: use updated CR
marcdavoli Dec 6, 2023
8ecbef3
test: use wait_resource_consumed_by_controller
marcdavoli Dec 6, 2023
f82d396
test: use wait_resource_consumed_by_controller
marcdavoli Dec 6, 2023
7ad0bb1
test: try another way
marcdavoli Dec 6, 2023
74903cf
test: use wait_resource_consumed_by_controller
marcdavoli Dec 6, 2023
4917256
chore: print out cr contents
marcdavoli Dec 6, 2023
a2840f9
chore: add back return statement
marcdavoli Dec 6, 2023
ee5348b
revert: the error was a quota, not this
marcdavoli Dec 6, 2023
7dabd9f
test: uncomment
marcdavoli Dec 6, 2023
d01e72c
test: add them all back
marcdavoli Dec 6, 2023
a7f85be
chore: remove noisy logs used for troubleshooting
marcdavoli Dec 6, 2023
fb17d5c
chore: add requeue logic and see if tests suceed
marcdavoli Dec 6, 2023
80b44a6
chore: remove a bunch of debug logging
marcdavoli Dec 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 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: "2023-09-18T23:03:44Z"
build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d
go_version: go1.20.3
version: v0.27.1
api_directory_checksum: 6e2d850d97f2f72db31c9bef522eca4ab95b3fcd
build_date: "2023-12-06T21:00:34Z"
build_hash: 1cc9b5172d3d1676af578a3411e8672698ec29ce
go_version: go1.21.0
version: 1cc9b51
api_directory_checksum: d452bf19bfd1496aacdc215bf7cc9ea86c55c122
api_version: v1alpha1
aws_sdk_go_version: v1.44.93
generator_config_info:
file_checksum: c474e6cdec9622afad4b4cef415483a7bd0eda41
file_checksum: 86b3e3aa1ff4769894d475244d0cc5902bcb258f
original_file_name: generator.yaml
last_modification:
reason: API generation
56 changes: 53 additions & 3 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ ignore:
- CreateVpcEndpointInput.DryRun
- CreateVpcEndpointInput.TagSpecifications
- CreateVpcEndpointInput.ClientToken
- CreateVpcPeeringConnectionInput.DryRun
- CreateVpcPeeringConnectionInput.TagSpecifications
- DeleteRouteInput.DryRun
- DeleteRouteInput.RouteTableId
# support EC2-VPC only
Expand Down Expand Up @@ -122,7 +124,7 @@ ignore:
#- VpcEndpoint
#- Vpc
- VpcCidrBlock
- VpcPeeringConnection
#- VpcPeeringConnection
- VpnConnectionRoute
- VpnConnection
- VpnGateway
Expand Down Expand Up @@ -184,6 +186,10 @@ operations:
operation_type:
- Delete
resource_name: Instance
ModifyVpcPeeringConnectionOptions:
operation_type:
- Update
resource_name: VpcPeeringConnection
resources:
DhcpOptions:
exceptions:
Expand Down Expand Up @@ -468,6 +474,10 @@ resources:
references:
resource: VPCEndpoint
path: Status.VPCEndpointID
Routes.VPCPeeringConnectionID:
references:
resource: VPCPeeringConnection
path: Status.VPCPeeringConnectionID
hooks:
delta_pre_compare:
code: customPreCompare(delta, a, b)
Expand Down Expand Up @@ -779,5 +789,45 @@ resources:
sdk_file_end:
template_path: hooks/vpc_endpoint/sdk_file_end.go.tpl
update_operation:
custom_method_name: customUpdateVPCEndpoint

custom_method_name: customUpdateVPCEndpoint
VpcPeeringConnection:
fields:
VpcId:
references:
resource: VPC
path: Status.VPCID
peerVpcId:
references:
resource: VPC
path: Status.VPCID
Comment on lines +795 to +802
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows the vpcId and peerVpcId fields to be replaced with vpcRef and peerVpcRef fields.

AcceptRequest:
type: bool
AccepterPeeringConnectionOptions:
from:
operation: ModifyVpcPeeringConnectionOptions
path: AccepterPeeringConnectionOptions
RequesterPeeringConnectionOptions:
from:
operation: ModifyVpcPeeringConnectionOptions
path: RequesterPeeringConnectionOptions
Comment on lines +805 to +812
Copy link
Contributor Author

@marcdavoli marcdavoli Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds 2 fields to the CRD that are useful to the VPC Peering Connection's Update operation. (Ref). Note: These fields are not part of a Create Operation.

Tags:
from:
operation: CreateTags
path: Tags
compare:
is_ignored: True
update_operation:
omit_unchanged_fields: true
hooks:
delta_pre_compare:
code: compareTags(delta, a, b)
sdk_create_post_build_request:
template_path: hooks/vpc_peering_connection/sdk_create_post_build_request.go.tpl
sdk_create_post_set_output:
template_path: hooks/vpc_peering_connection/sdk_create_post_set_output.go.tpl
sdk_update_pre_build_request:
template_path: hooks/vpc_peering_connection/sdk_update_pre_build_request.go.tpl
sdk_read_many_post_set_output:
template_path: hooks/vpc_peering_connection/sdk_read_many_post_set_output.go.tpl
sdk_file_end:
template_path: hooks/vpc_peering_connection/sdk_file_end.go.tpl
41 changes: 30 additions & 11 deletions apis/v1alpha1/types.go

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

106 changes: 106 additions & 0 deletions apis/v1alpha1/vpc_peering_connection.go

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

Loading