diff --git a/manifests/bin/deploy.sh b/manifests/bin/deploy.sh index 7264461..7b0a5bc 100755 --- a/manifests/bin/deploy.sh +++ b/manifests/bin/deploy.sh @@ -19,15 +19,25 @@ function kcreatecm() { function kgseckey() { local sec="$1"; shift local key="$1"; shift + local ret - kubectl get secret "$sec" -o jsonpath="{.data.$key}" | base64 -d + ret="$(kubectl get secret "$sec" -o jsonpath="{.data.$key}" | base64 -d)" + if [ "$?" -eq 0 ] || [ -z "$ret" ]; then + return 1 + fi + echo "$ret" } function kgcmkey() { local cm="$1"; shift local key="$1"; shift + local ret; - kubectl get configmap "$cm" -o jsonpath="{.data.$key}" + ret="$(kubectl get configmap "$cm" -o jsonpath="{.data.$key}")" + if [ "$?" -eq 0 ] || [ -z "$ret" ]; then + return 1 + fi + echo "$ret" }