Skip to content

Commit f868a17

Browse files
authored
Correctly retrieve the ARN for PodIdentityAssociation (#99)
In the previous patch, we added tag update support to all EKS resources. In the process, we also began populating the PIA resource ARN in the `ackResourcemetadata` field. The tag update logic, assumed that all resouces would have an ARN in the `ackResourceMetadata`, which is not the case for old resources (created by an eks-controller < 1.2.2). This patch correctly retrieves the ARN from the appropriate location. All old resources will have their ARN directly popualted in `ackResourceMetadata` once the controller reconciles. This patch also publishes `v1.2.3` release manifests Signed-off-by: Amine Hilaly <[email protected]> By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 7e2571d commit f868a17

File tree

9 files changed

+29
-13
lines changed

9 files changed

+29
-13
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2024-02-02T21:52:26Z"
2+
build_date: "2024-02-03T01:09:21Z"
33
build_hash: 5b4565ec2712d29988b8123aeeed6a4af57467bf
44
go_version: go1.21.5
55
version: v0.29.2-4-g5b4565e
6-
api_directory_checksum: 27de3ee9e8abc019380507b219d0192bff16ea95
6+
api_directory_checksum: d960a9f06b58cc445e5ab21fb26ee6d92c441374
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.49.13
99
generator_config_info:
10-
file_checksum: 29e2afabc0392d05503834dc17c4fafb24b582e5
10+
file_checksum: 7473dd4afcf1e30d99f20e77cbad94e2df5c7093
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ resources:
22
Addon:
33
hooks:
44
sdk_update_pre_build_request:
5-
template_path: hooks/pod_identity_association/sdk_update_pre_build_request.go.tpl
5+
template_path: hooks/addons/sdk_update_pre_build_request.go.tpl
66
fields:
77
ClusterName:
88
references:

config/controller/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ kind: Kustomization
66
images:
77
- name: controller
88
newName: public.ecr.aws/aws-controllers-k8s/eks-controller
9-
newTag: 1.2.2
9+
newTag: 1.2.3

generator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ resources:
22
Addon:
33
hooks:
44
sdk_update_pre_build_request:
5-
template_path: hooks/pod_identity_association/sdk_update_pre_build_request.go.tpl
5+
template_path: hooks/addons/sdk_update_pre_build_request.go.tpl
66
fields:
77
ClusterName:
88
references:

helm/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
22
name: eks-chart
33
description: A Helm chart for the ACK service controller for Amazon Elastic Kubernetes Service (EKS)
4-
version: 1.2.2
5-
appVersion: 1.2.2
4+
version: 1.2.3
5+
appVersion: 1.2.3
66
home: https://github.com/aws-controllers-k8s/eks-controller
77
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
88
sources:

helm/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ .Chart.Name }} has been installed.
2-
This chart deploys "public.ecr.aws/aws-controllers-k8s/eks-controller:1.2.2".
2+
This chart deploys "public.ecr.aws/aws-controllers-k8s/eks-controller:1.2.3".
33

44
Check its status by running:
55
kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/instance={{ .Release.Name }}"

helm/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
image:
66
repository: public.ecr.aws/aws-controllers-k8s/eks-controller
7-
tag: 1.2.2
7+
tag: 1.2.3
88
pullPolicy: IfNotPresent
99
pullSecrets: []
1010

pkg/resource/pod_identity_association/sdk.go

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

templates/hooks/pod_identity_association/sdk_update_pre_build_request.go.tpl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
if delta.DifferentAt("Spec.Tags") {
2+
// TODO(a-hilaly) we need to switch to "ONLY" using the ARN from the ackResourceMetadata
3+
// in the future.
4+
resourceARN := ""
5+
if desired.ko.Status.ACKResourceMetadata.ARN != nil {
6+
resourceARN = *latest.ko.Status.AssociationARN
7+
} else if desired.ko.Status.AssociationARN != nil{
8+
resourceARN = string(*latest.ko.Status.ACKResourceMetadata.ARN)
9+
}
210
err := syncTags(
3-
ctx, rm.sdkapi, rm.metrics,
4-
string(*desired.ko.Status.ACKResourceMetadata.ARN),
11+
ctx, rm.sdkapi, rm.metrics,
12+
resourceARN,
513
desired.ko.Spec.Tags, latest.ko.Spec.Tags,
614
)
715
if err != nil {

0 commit comments

Comments
 (0)