sso: recheck mas encryption bytes
This commit is contained in:
parent
8d1284412f
commit
d3c3db612d
@ -8,7 +8,7 @@ metadata:
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: mas-secrets-ensure-11
|
||||
name: mas-secrets-ensure-12
|
||||
namespace: sso
|
||||
spec:
|
||||
backoffLimit: 0
|
||||
@ -89,11 +89,10 @@ spec:
|
||||
args:
|
||||
- |
|
||||
set -euo pipefail
|
||||
current=""
|
||||
if kubectl -n comms get secret mas-secrets-runtime >/dev/null 2>&1; then
|
||||
current="$(kubectl -n comms get secret mas-secrets-runtime -o jsonpath='{.data.encryption}' | base64 -d 2>/dev/null || true)"
|
||||
current_len="$(printf '%s' "${current}" | wc -c | tr -d ' ')"
|
||||
if [ "${current_len}" = "64" ] && printf '%s' "${current}" | grep -Eq '^[0-9a-fA-F]{64}$'; then
|
||||
kubectl -n comms get secret mas-secrets-runtime -o jsonpath='{.data.encryption}' | base64 -d 2>/dev/null > /tmp/encryption.current || true
|
||||
current_len="$(wc -c < /tmp/encryption.current | tr -d ' ')"
|
||||
if [ "${current_len}" = "64" ] && grep -Eq '^[0-9a-fA-F]{64}$' /tmp/encryption.current; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user