Fix environment variables

When a bash array is read into a variable, the syntax must be read -r -a <variable name> not read -ar
This fixes ENTRYPOINT_SKIP_SCRIPTS as well as DOCKER_APP_ENSURE_OWNERSHIP_PATHS
This commit is contained in:
Anil Kulkarni 2024-05-19 13:40:15 -07:00
parent 1f3243222b
commit 69f3e94f09
No known key found for this signature in database
GPG key ID: 4806669421E998D3
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@ run-as-current-user chown --verbose --recursive "${RUNTIME_UID}:${RUNTIME_GID}"
: "${DOCKER_APP_ENSURE_OWNERSHIP_PATHS:=""}" : "${DOCKER_APP_ENSURE_OWNERSHIP_PATHS:=""}"
declare -a ensure_ownership_paths=() declare -a ensure_ownership_paths=()
IFS=' ' read -ar ensure_ownership_paths <<<"${DOCKER_APP_ENSURE_OWNERSHIP_PATHS}" IFS=' ' read -r -a ensure_ownership_paths <<<"${DOCKER_APP_ENSURE_OWNERSHIP_PATHS}"
if [[ ${#ensure_ownership_paths[@]} == 0 ]]; then if [[ ${#ensure_ownership_paths[@]} == 0 ]]; then
log-info "No paths has been configured for ownership fixes via [\$DOCKER_APP_ENSURE_OWNERSHIP_PATHS]." log-info "No paths has been configured for ownership fixes via [\$DOCKER_APP_ENSURE_OWNERSHIP_PATHS]."

View file

@ -28,7 +28,7 @@ entrypoint-set-script-name "entrypoint.sh"
# Convert ENTRYPOINT_SKIP_SCRIPTS into a native bash array for easier lookup # Convert ENTRYPOINT_SKIP_SCRIPTS into a native bash array for easier lookup
declare -a skip_scripts declare -a skip_scripts
# shellcheck disable=SC2034 # shellcheck disable=SC2034
IFS=' ' read -ar skip_scripts <<< "$ENTRYPOINT_SKIP_SCRIPTS" IFS=' ' read -r -a skip_scripts <<< "$ENTRYPOINT_SKIP_SCRIPTS"
# Ensure the entrypoint root folder exists # Ensure the entrypoint root folder exists
mkdir -p "${ENTRYPOINT_D_ROOT}" mkdir -p "${ENTRYPOINT_D_ROOT}"