Skip to content

Commit

Permalink
fix agent builds when local mirror is used (#1485)
Browse files Browse the repository at this point in the history
Keep OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE as OPENSHIFT_RELEASE_IMAGE when the release tag is a digest (usually this happens in the CI), since it's used in different parts of the workflow (ie when generating the ztp manifests)
  • Loading branch information
andfasano authored Nov 30, 2022
1 parent 915d147 commit 2f0b758
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,13 @@ if [[ -n "$MIRROR_IMAGES" || -z "${IP_STACK:-}" || "$IP_STACK" = "v6" ]]; then
# We're going to be using a locally modified release image
if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then
# For the agent installer version check, a valid tag must be supplied (not 'latest').
if [[ ${#OPENSHIFT_RELEASE_TAG} = 64 ]] && [[ ${OPENSHIFT_RELEASE_TAG} =~ [:alnum:] ]]; then
# If the tag is a digest, don't change the override from OPENSHIFT_RELEASE_IMAGE
# Since mirror-by-digest-only = true on the bootstrap
echo "Not changing OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE since digest is being used"
else
export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="${LOCAL_REGISTRY_DNS_NAME}:${LOCAL_REGISTRY_PORT}/${LOCAL_IMAGE_URL_SUFFIX}:${OPENSHIFT_RELEASE_TAG}"
fi
if [[ ${#OPENSHIFT_RELEASE_TAG} = 64 ]] && [[ ${OPENSHIFT_RELEASE_TAG} =~ [:alnum:] ]]; then
# If the tag is a digest, let's keep the override as OPENSHIFT_RELEASE_IMAGE
# Since mirror-by-digest-only = true on the bootstrap
export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="${OPENSHIFT_RELEASE_IMAGE}"
else
export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="${LOCAL_REGISTRY_DNS_NAME}:${LOCAL_REGISTRY_PORT}/${LOCAL_IMAGE_URL_SUFFIX}:${OPENSHIFT_RELEASE_TAG}"
fi
else
# 04_setup_ironic requires tag to be 'latest'
export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="${LOCAL_REGISTRY_DNS_NAME}:${LOCAL_REGISTRY_PORT}/${LOCAL_IMAGE_URL_SUFFIX}:latest"
Expand Down

0 comments on commit 2f0b758

Please sign in to comment.