From f6103198220365b2e1a38fa51877b15e834b9801 Mon Sep 17 00:00:00 2001 From: Simon Baeumer Date: Thu, 15 May 2025 10:13:25 +0200 Subject: [PATCH] Fix unbound variable --- scripts/dev/configure_docker_auth.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/dev/configure_docker_auth.sh b/scripts/dev/configure_docker_auth.sh index 27b2e1c61..0a2c68365 100755 --- a/scripts/dev/configure_docker_auth.sh +++ b/scripts/dev/configure_docker_auth.sh @@ -81,13 +81,15 @@ fi aws ecr get-login-password --region "eu-west-1" | docker login --username AWS --password-stdin 268558157000.dkr.ecr.eu-west-1.amazonaws.com -# log in to quay.io for the mongodb/mongodb-search-community private repo -# TODO remove once we switch to the official repo in Public Preview -quay_io_auth_file=$(mktemp) -docker_configjson_tmp=$(mktemp) -echo "${COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON}" | base64 -d > "${quay_io_auth_file}" -jq -s '.[0] * .[1]' "${quay_io_auth_file}" ~/.docker/config.json > "${docker_configjson_tmp}" -mv "${docker_configjson_tmp}" ~/.docker/config.json -rm "${quay_io_auth_file}" +if [[ -n "${COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON:-}" ]]; then + # log in to quay.io for the mongodb/mongodb-search-community private repo + # TODO remove once we switch to the official repo in Public Preview + quay_io_auth_file=$(mktemp) + docker_configjson_tmp=$(mktemp) + echo "${COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON}" | base64 -d > "${quay_io_auth_file}" + jq -s '.[0] * .[1]' "${quay_io_auth_file}" ~/.docker/config.json > "${docker_configjson_tmp}" + mv "${docker_configjson_tmp}" ~/.docker/config.json + rm "${quay_io_auth_file}" +fi create_image_registries_secret