Skip to content

Commit b6f5ba5

Browse files
authored
mitigate controller panic when adopting resources (#132)
Description of changes: When adopting resources, the desired status arn is nil, and it causes the controller to panic and exit To ensure this doesn't happen, we are retrieving the resource ARN from AWS API By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent ed203f9 commit b6f5ba5

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ack_generate_info:
2-
build_date: "2024-09-30T17:24:49Z"
2+
build_date: "2024-10-01T19:56:53Z"
33
build_hash: f8f98563404066ac3340db0a049d2e530e5c51cc
44
go_version: go1.23.0
55
version: v0.38.1

pkg/resource/access_entry/sdk.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/resource/fargate_profile/hook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (rm *resourceManager) customUpdate(
7676
if delta.DifferentAt("Spec.Tags") {
7777
if err := tags.SyncTags(
7878
ctx, rm.sdkapi, rm.metrics,
79-
string(*desired.ko.Status.ACKResourceMetadata.ARN),
79+
string(*latest.ko.Status.ACKResourceMetadata.ARN),
8080
desired.ko.Spec.Tags, latest.ko.Spec.Tags,
8181
); err != nil {
8282
return nil, err

pkg/resource/nodegroup/hook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func (rm *resourceManager) customUpdate(
265265
if delta.DifferentAt("Spec.Tags") {
266266
err := tags.SyncTags(
267267
ctx, rm.sdkapi, rm.metrics,
268-
string(*desired.ko.Status.ACKResourceMetadata.ARN),
268+
string(*latest.ko.Status.ACKResourceMetadata.ARN),
269269
desired.ko.Spec.Tags, latest.ko.Spec.Tags,
270270
)
271271
if err != nil {

templates/hooks/access_entry/sdk_update_pre_build_request.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
if delta.DifferentAt("Spec.Tags") {
88
err := syncTags(
99
ctx, rm.sdkapi, rm.metrics,
10-
string(*desired.ko.Status.ACKResourceMetadata.ARN),
10+
string(*latest.ko.Status.ACKResourceMetadata.ARN),
1111
desired.ko.Spec.Tags, latest.ko.Spec.Tags,
1212
)
1313
if err != nil {

0 commit comments

Comments
 (0)