Skip to content

Commit 3114ad3

Browse files
authored
fix: ensure references are not overwritten (#165)
Issue [#2431](aws-controllers-k8s/community#2431) Description of changes: Nested references get overwritten during reconciliation. This eventually needs to be fixed in code-generator. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 630c3d1 commit 3114ad3

File tree

5 files changed

+41
-17
lines changed

5 files changed

+41
-17
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ack_generate_info:
2-
build_date: "2025-03-27T16:32:48Z"
3-
build_hash: 980cb1e4734f673d16101cf55206b84ca639ec01
2+
build_date: "2025-04-18T02:07:04Z"
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: b37edb8bba9d3847d4bdf1e842b7a597821c8c37
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6

pkg/resource/alias/sdk.go

+2-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/resource/function/sdk.go

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/hooks/function/sdk_create_post_set_output.go.tpl

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
if desired.ko.Spec.VPCConfig != nil {
2+
if ko.Spec.VPCConfig == nil {
3+
ko.Spec.VPCConfig = &svcapitypes.VPCConfig{}
4+
}
5+
ko.Spec.VPCConfig.SecurityGroupRefs = desired.ko.Spec.VPCConfig.SecurityGroupRefs
6+
ko.Spec.VPCConfig.SubnetRefs = desired.ko.Spec.VPCConfig.SubnetRefs
7+
}
8+
19
if resp.Layers != nil {
210
f16 := []*svcapitypes.Layer{}
311
for _, f16iter := range resp.Layers {

templates/hooks/function/sdk_read_one_post_set_output.go.tpl

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
if r.ko.Spec.VPCConfig != nil {
2+
if ko.Spec.VPCConfig == nil {
3+
ko.Spec.VPCConfig = &svcapitypes.VPCConfig{}
4+
}
5+
ko.Spec.VPCConfig.SecurityGroupRefs = r.ko.Spec.VPCConfig.SecurityGroupRefs
6+
ko.Spec.VPCConfig.SubnetRefs = r.ko.Spec.VPCConfig.SubnetRefs
7+
}
18
if resp.Code != nil {
29
if ko.Spec.Code == nil {
310
ko.Spec.Code = &svcapitypes.FunctionCode{}
@@ -6,6 +13,9 @@
613
ko.Spec.Code.ImageURI = resp.Code.ImageUri
714
}
815
}
16+
if r.ko.Spec.Code != nil && r.ko.Spec.Code.S3BucketRef != nil {
17+
ko.Spec.Code.S3BucketRef = r.ko.Spec.Code.S3BucketRef
18+
}
919
if resp.Configuration.Layers != nil {
1020
f16 := []*svcapitypes.Layer{}
1121
layer := []*string{}

0 commit comments

Comments
 (0)