From 7ce05f422f834aca07772f79aba92839363bb41a Mon Sep 17 00:00:00 2001 From: Thomas Lecavelier Date: Tue, 9 Jan 2024 09:37:03 +0100 Subject: [PATCH] https://github.com/passbolt/charts-passbolt/issues/73 Download correct kubectl version according cpu architecture --- templates/job-create-jwt.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/job-create-jwt.yaml b/templates/job-create-jwt.yaml index e35b5f7..0e8b985 100644 --- a/templates/job-create-jwt.yaml +++ b/templates/job-create-jwt.yaml @@ -45,7 +45,8 @@ spec: PUBLIC_JWT_KEY="$(cat {{ .Values.jwtPath }}/jwt.pem | base64 -w0 )" cd /tmp - kubectlDownload=${KUBECTL_DOWNLOAD_CMD:-'curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"'} + cpuArch=${CPU_ARCH:-$(eval "case `uname -m` in 'x86_64') echo 'amd64';;'aarch64') echo 'arm64';;esac")} + kubectlDownload=${KUBECTL_DOWNLOAD_CMD:-'curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${cpuArch}/kubectl"'} eval $kubectlDownload chmod +x kubectl ./kubectl patch secret {{ $Name }}-sec-jwt --type='json' -p='[{"op": "replace", "path" : "/data/jwt.key", "value" : '"${PUBLIC_JWT_KEY}"'}]'