Skip to content

Commit 486f26d

Browse files
authored
Prepare repository for tag conversion function signature update (#68)
Description of changes: The To/FromACKTags function signatures are changing with the next code-gen release. This PR aims to ensure custom code adapts as well. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 0c75b13 commit 486f26d

File tree

12 files changed

+173
-80
lines changed

12 files changed

+173
-80
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-03-04T22:14:14Z"
3-
build_hash: a326346bd3a6973254d247c9ab2dc76790c36241
2+
build_date: "2025-03-14T20:40:51Z"
3+
build_hash: 0ab258c51775fd52af32e649da00d57373b20869
44
go_version: go1.24.0
5-
version: v0.43.2
5+
version: v0.43.2-6-g0ab258c
66
api_directory_checksum: b920521646bacef1fba9d0b97a423d11565c7a60
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 262cace7fe285ca8833a0f656963c0f5872b0404
10+
file_checksum: cb391b9a34945fd5dd28af68abd902a68d209e93
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ resources:
187187
template_path: hooks/hosted_zone/sdk_file_end.go.tpl
188188
ensure_tags:
189189
template_path: hooks/hosted_zone/sdk_ensure_tags.go.tpl
190-
tags:
191-
ignore: true
192190
update_operation:
193191
custom_method_name: customUpdateHostedZone
194192
HealthCheck:

generator.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ resources:
187187
template_path: hooks/hosted_zone/sdk_file_end.go.tpl
188188
ensure_tags:
189189
template_path: hooks/hosted_zone/sdk_ensure_tags.go.tpl
190-
tags:
191-
ignore: true
192190
update_operation:
193191
custom_method_name: customUpdateHostedZone
194192
HealthCheck:

pkg/resource/health_check/hooks.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,12 @@ func (rm *resourceManager) syncTags(
305305

306306
resourceId := latest.ko.Status.ID
307307

308-
desiredTags := ToACKTags(desired.ko.Spec.Tags)
309-
latestTags := ToACKTags(latest.ko.Spec.Tags)
308+
desiredTags, _ := convertToOrderedACKTags(desired.ko.Spec.Tags)
309+
latestTags, _ := convertToOrderedACKTags(latest.ko.Spec.Tags)
310310

311311
added, _, removed := ackcompare.GetTagsDifference(latestTags, desiredTags)
312312

313-
toAdd := FromACKTags(added)
313+
toAdd := fromACKTags(added, nil)
314314

315315
var toDeleteTagKeys []*string
316316
for k, _ := range removed {
@@ -377,13 +377,13 @@ func compareTags(
377377
if len(a.ko.Spec.Tags) != len(b.ko.Spec.Tags) {
378378
delta.Add("Spec.Tags", a.ko.Spec.Tags, b.ko.Spec.Tags)
379379
} else if len(a.ko.Spec.Tags) > 0 {
380-
desiredTags := ToACKTags(a.ko.Spec.Tags)
381-
latestTags := ToACKTags(b.ko.Spec.Tags)
380+
desiredTags, _ := convertToOrderedACKTags(a.ko.Spec.Tags)
381+
latestTags, _ := convertToOrderedACKTags(b.ko.Spec.Tags)
382382

383383
added, _, removed := ackcompare.GetTagsDifference(latestTags, desiredTags)
384384

385-
toAdd := FromACKTags(added)
386-
toDelete := FromACKTags(removed)
385+
toAdd := fromACKTags(added, nil)
386+
toDelete := fromACKTags(removed, nil)
387387

388388
if len(toAdd) != 0 || len(toDelete) != 0 {
389389
delta.Add("Spec.Tags", a.ko.Spec.Tags, b.ko.Spec.Tags)

pkg/resource/health_check/manager.go

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

pkg/resource/health_check/tags.go

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

pkg/resource/hosted_zone/hook.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ func (rm *resourceManager) syncTags(
6464
//
6565
resourceId := aws.String(strings.TrimPrefix(*latest.ko.Status.ID, "/hostedzone/"))
6666

67-
desiredTags := ToACKTags(desired.ko.Spec.Tags)
68-
latestTags := ToACKTags(latest.ko.Spec.Tags)
67+
desiredTags, _ := convertToOrderedACKTags(desired.ko.Spec.Tags)
68+
latestTags, _ := convertToOrderedACKTags(latest.ko.Spec.Tags)
6969

7070
added, _, removed := ackcompare.GetTagsDifference(latestTags, desiredTags)
7171

72-
toAdd := FromACKTags(added)
72+
toAdd := fromACKTags(added, nil)
7373

7474
var toDeleteTagKeys []*string
7575
for k := range removed {
@@ -136,13 +136,13 @@ func compareTags(
136136
if len(a.ko.Spec.Tags) != len(b.ko.Spec.Tags) {
137137
delta.Add("Spec.Tags", a.ko.Spec.Tags, b.ko.Spec.Tags)
138138
} else if len(a.ko.Spec.Tags) > 0 {
139-
desiredTags := ToACKTags(a.ko.Spec.Tags)
140-
latestTags := ToACKTags(b.ko.Spec.Tags)
139+
desiredTags, _ := convertToOrderedACKTags(a.ko.Spec.Tags)
140+
latestTags, _ := convertToOrderedACKTags(b.ko.Spec.Tags)
141141

142142
added, _, removed := ackcompare.GetTagsDifference(latestTags, desiredTags)
143143

144-
toAdd := FromACKTags(added)
145-
toDelete := FromACKTags(removed)
144+
toAdd := fromACKTags(added, nil)
145+
toDelete := fromACKTags(removed, nil)
146146

147147
if len(toAdd) != 0 || len(toDelete) != 0 {
148148
delta.Add("Spec.Tags", a.ko.Spec.Tags, b.ko.Spec.Tags)

pkg/resource/hosted_zone/manager.go

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

pkg/resource/hosted_zone/sdk.go

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

0 commit comments

Comments
 (0)