Skip to content

Commit 3067f1b

Browse files
authored
add vpcid during adoption (#261)
fixes aws-controllers-k8s/community#2419 Description of changes: add `read_many_post_set_output` hook to populate `vpcid` during adoption of VPC Peering Connection By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent b6dff77 commit 3067f1b

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ack_generate_info:
2-
build_date: "2025-04-02T20:13:02Z"
3-
build_hash: 980cb1e4734f673d16101cf55206b84ca639ec01
2+
build_date: "2025-04-14T02:36:47Z"
3+
build_hash: 0909e7f0adb8ffe4120a8c20d5d58b991f2539e9
44
go_version: go1.24.1
5-
version: v0.44.0
5+
version: v0.44.0-3-g0909e7f
66
api_directory_checksum: 5e4731f8ab6fa4bafdb863edf0e678e604697103
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6

pkg/resource/vpc_peering_connection/sdk.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/hooks/vpc_peering_connection/sdk_read_many_post_set_output.go.tpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
// This prevents reference resolution errors when adopting existing resources where these fields are not provided in the manifest.
3+
if ko.Spec.VPCID == nil && ko.Status.RequesterVPCInfo != nil && ko.Status.RequesterVPCInfo.VPCID != nil {
4+
ko.Spec.VPCID = ko.Status.RequesterVPCInfo.VPCID
5+
}
26

37
if r.ko.Spec.AccepterPeeringConnectionOptions != nil {
48
f0 := &svcapitypes.PeeringConnectionOptionsRequest{}
@@ -39,4 +43,4 @@
3943
res.ko.Spec.AcceptRequest = aws.Bool(true)
4044
} else if isVPCPeeringConnectionCreating(res) {
4145
return res, requeueWaitWhileCreating
42-
}
46+
}

0 commit comments

Comments
 (0)