diff --git a/services/communication/mas-admin-client-secret-ensure-job.yaml b/services/communication/mas-admin-client-secret-ensure-job.yaml index 3863f2b..5a9241d 100644 --- a/services/communication/mas-admin-client-secret-ensure-job.yaml +++ b/services/communication/mas-admin-client-secret-ensure-job.yaml @@ -33,7 +33,7 @@ subjects: apiVersion: batch/v1 kind: Job metadata: - name: mas-admin-client-secret-ensure-3 + name: mas-admin-client-secret-ensure-4 namespace: comms spec: backoffLimit: 2 @@ -50,7 +50,7 @@ spec: command: ["/bin/sh", "-c"] args: - | - set -euo pipefail + set -eu umask 077 dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -An -tx1 | tr -d ' \n' > /work/client_secret volumeMounts: @@ -62,8 +62,8 @@ spec: command: ["/bin/sh", "-c"] args: - | - set -euo pipefail - if kubectl -n comms get secret mas-admin-client -o jsonpath='{.data.client_secret}' 2>/dev/null | grep -q .; then + set -eu + if [ -n "$(kubectl -n comms get secret mas-admin-client -o jsonpath='{.data.client_secret}' 2>/dev/null || true)" ]; then exit 0 fi secret="$(cat /work/client_secret)"