From 0ba5c1954b47d806f6e8feb209580c2d9ab8d2d2 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Tue, 8 Nov 2022 15:30:45 +0100 Subject: [PATCH] chore(vault): check for error file Signed-off-by: rjshrjndrn --- .../helmcharts/openreplay/templates/job.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/helmcharts/openreplay/templates/job.yaml b/scripts/helmcharts/openreplay/templates/job.yaml index 55a68c460..127809765 100644 --- a/scripts/helmcharts/openreplay/templates/job.yaml +++ b/scripts/helmcharts/openreplay/templates/job.yaml @@ -179,14 +179,16 @@ spec: aws s3 cp --endpoint ${AWS_ENDPOINT} /opt/openreplay/vault_creds.txt s3://${VAULT_BUCKET}/vault/ exit 0 } || { - (cat /opt/openreplay/err.txt | grep -i "vault is already initialized") && { - cat /opt/openreplay/err.txt - echo vault already initialized - exit 0 - } || { - echo Unknown error - cat /opt/openreplay/err.txt - exit 2 + [[ -f /opt/openreplay/err.txt ]] && { + (cat /opt/openreplay/err.txt | grep -i "vault is already initialized") && { + cat /opt/openreplay/err.txt + echo vault already initialized + exit 0 + } || { + echo Unknown error + cat /opt/openreplay/err.txt + exit 2 + } } } || { echo vault not yet initialized;