Fix sourced vault bootstrap exits
This commit is contained in:
@@ -2,20 +2,20 @@
|
||||
set -eu
|
||||
|
||||
if [ "${VAULT_ENABLED:-auto}" = "false" ] || [ "${VAULT_ENABLED:-auto}" = "0" ]; then
|
||||
exit 0
|
||||
return 0 2>/dev/null || exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${VAULT_ADDR:-}" ] || [ -z "${VAULT_TOKEN:-}" ]; then
|
||||
if [ "${VAULT_ENABLED:-auto}" = "true" ] || [ "${VAULT_ENABLED:-auto}" = "1" ]; then
|
||||
echo "VAULT_ENABLED=true but VAULT_ADDR/VAULT_TOKEN are not set" >&2
|
||||
exit 1
|
||||
return 1 2>/dev/null || exit 1
|
||||
fi
|
||||
exit 0
|
||||
return 0 2>/dev/null || exit 0
|
||||
fi
|
||||
|
||||
if ! command -v curl >/dev/null 2>&1 || ! command -v jq >/dev/null 2>&1; then
|
||||
echo "Vault bootstrap requires curl and jq." >&2
|
||||
exit 1
|
||||
return 1 2>/dev/null || exit 1
|
||||
fi
|
||||
|
||||
kv_mount="${VAULT_KV_MOUNT:-secret}"
|
||||
|
||||
Reference in New Issue
Block a user