From 8aa4c9242f796ecbbf5d25f2a26891d66e5bde07 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 4 Sep 2024 20:05:56 +0200 Subject: [PATCH] fix(setup): Use single-line command --- helm/cluster_setup/Chart.yaml | 4 ++-- helm/cluster_setup/templates/ecr-token-helper.yaml | 13 +++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/helm/cluster_setup/Chart.yaml b/helm/cluster_setup/Chart.yaml index d7f0abf..1af9a58 100644 --- a/helm/cluster_setup/Chart.yaml +++ b/helm/cluster_setup/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: cluster_setup -version: 0.6.2 +version: 0.6.3 type: application description: "Initial cluster setup" maintainers: @@ -9,7 +9,7 @@ maintainers: annotations: artifacthub.io/changes: | - kind: fixed - description: Fixed missing namespace values + description: Use single-line command artifacthub.io/signKey: | fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8 url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc diff --git a/helm/cluster_setup/templates/ecr-token-helper.yaml b/helm/cluster_setup/templates/ecr-token-helper.yaml index 6e76447..3be83af 100644 --- a/helm/cluster_setup/templates/ecr-token-helper.yaml +++ b/helm/cluster_setup/templates/ecr-token-helper.yaml @@ -80,17 +80,10 @@ spec: serviceAccountName: sa-ecr-token-helper containers: - command: - - /bin/sh + - /bin/sh + args: - -c - - |- - TOKEN=`aws ecr get-login-password --region ${REGION} | cut -d' ' -f6` - kubectl delete secret -n {{ .name }} --ignore-not-found $SECRET_NAME - kubectl create secret -n {{ .name }} docker-registry $SECRET_NAME \ - --docker-server=$ECR_REPOSITORY \ - --docker-username=AWS \ - --docker-password=$TOKEN \ - --namespace={{ .name }} - kubectl patch serviceaccount default -p '{"imagePullSecrets":[{"name":"'$SECRET_NAME'"}]}' -n {{ .name }} + - TOKEN=`aws ecr get-login-password --region $REGION | cut -d' ' -f6`; kubectl delete secret -n {{ .name }} --ignore-not-found $SECRET_NAME; kubectl create secret -n {{ .name }} docker-registry $SECRET_NAME --docker-server=$ECR_REPOSITORY --docker-username=AWS --docker-password=$TOKEN; kubectl patch serviceaccount default -p '{"imagePullSecrets":[{"name":"$SECRET_NAME"}]}' -n {{ .name }} env: - name: SECRET_NAME value: 'ecrcred'