Fix sourced vault bootstrap exits
This commit is contained in:
@@ -69,20 +69,20 @@ wait_for_tcp() {
|
|||||||
|
|
||||||
VAULT_ENABLED="${VAULT_ENABLED:-auto}"
|
VAULT_ENABLED="${VAULT_ENABLED:-auto}"
|
||||||
if [ "$VAULT_ENABLED" = "false" ] || [ "$VAULT_ENABLED" = "0" ]; then
|
if [ "$VAULT_ENABLED" = "false" ] || [ "$VAULT_ENABLED" = "0" ]; then
|
||||||
exit 0
|
return 0 2>/dev/null || exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${VAULT_ADDR:-}" ] || [ -z "${VAULT_TOKEN:-}" ]; then
|
if [ -z "${VAULT_ADDR:-}" ] || [ -z "${VAULT_TOKEN:-}" ]; then
|
||||||
if [ "$VAULT_ENABLED" = "true" ] || [ "$VAULT_ENABLED" = "1" ]; then
|
if [ "$VAULT_ENABLED" = "true" ] || [ "$VAULT_ENABLED" = "1" ]; then
|
||||||
log "Vault bootstrap is required but VAULT_ADDR or VAULT_TOKEN is missing."
|
log "Vault bootstrap is required but VAULT_ADDR or VAULT_TOKEN is missing."
|
||||||
exit 1
|
return 1 2>/dev/null || exit 1
|
||||||
fi
|
fi
|
||||||
exit 0
|
return 0 2>/dev/null || exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v curl >/dev/null 2>&1 || ! command -v jq >/dev/null 2>&1; then
|
if ! command -v curl >/dev/null 2>&1 || ! command -v jq >/dev/null 2>&1; then
|
||||||
log "Vault bootstrap requires curl and jq."
|
log "Vault bootstrap requires curl and jq."
|
||||||
exit 1
|
return 1 2>/dev/null || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VAULT_KV_MOUNT="${VAULT_KV_MOUNT:-secret}"
|
VAULT_KV_MOUNT="${VAULT_KV_MOUNT:-secret}"
|
||||||
@@ -144,7 +144,7 @@ if is_enabled "${WAIT_FOR_HATCHET_ENGINE:-0}"; then
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
log "Invalid HATCHET wait host:port value: ${hatchet_wait_host_port}"
|
log "Invalid HATCHET wait host:port value: ${hatchet_wait_host_port}"
|
||||||
exit 1
|
return 1 2>/dev/null || exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ if is_enabled "${WAIT_FOR_HATCHET_ENGINE:-0}"; then
|
|||||||
else
|
else
|
||||||
if [ -z "$hatchet_wait_url" ]; then
|
if [ -z "$hatchet_wait_url" ]; then
|
||||||
log "WAIT_FOR_HATCHET_ENGINE is enabled but no HATCHET wait target is configured."
|
log "WAIT_FOR_HATCHET_ENGINE is enabled but no HATCHET wait target is configured."
|
||||||
exit 1
|
return 1 2>/dev/null || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wait_for_http \
|
wait_for_http \
|
||||||
|
|||||||
Reference in New Issue
Block a user