Correctly map legacy whitelist vars APPEND_WHITELIST and OVERRIDE_WHITELIST

This commit is contained in:
Geoff Bourne 2024-04-29 15:53:08 -05:00
parent e8b46a3bcc
commit 90ee1a2e3e
1 changed files with 10 additions and 3 deletions

View File

@ -77,13 +77,20 @@ if [[ -v WHITELIST_FILE ]]; then
fi
if [[ -v WHITELIST ]]; then
args=()
if isTrue "${APPEND_WHITELIST:-false}" || isFalse "${OVERRIDE_WHITELIST:-true}"; then
args+=(--append-only)
fi
existing="$EXISTING_WHITELIST_FILE"
# Working with an OPS list, so normalize the value to a "non-file" mode
if [[ "$EXISTING_WHITELIST_FILE" = SYNC_FILE_MERGE_LIST ]]; then
existing=MERGE
fi
# legacy option
if [[ -v APPEND_WHITELIST ]] && isTrue "${APPEND_WHITELIST}"; then
existing=MERGE
fi
# legacy option
if [[ -v OVERRIDE_WHITELIST ]] && isFalse "${OVERRIDE_WHITELIST}"; then
existing=SKIP
fi
# shellcheck disable=SC2086
mc-image-helper manage-users \
"${sharedArgs[@]}" "${args[@]}" \