diff --git a/ci-operator/step-registry/cucushift/winc/prepare/cucushift-winc-prepare-commands.sh b/ci-operator/step-registry/cucushift/winc/prepare/cucushift-winc-prepare-commands.sh index 6a0b72fce6cac..ce5948ca57870 100755 --- a/ci-operator/step-registry/cucushift/winc/prepare/cucushift-winc-prepare-commands.sh +++ b/ci-operator/step-registry/cucushift/winc/prepare/cucushift-winc-prepare-commands.sh @@ -13,6 +13,61 @@ function create_winc_test_configmap() oc get cm winc-test-config -oyaml -n winc-test } +function setup_image_mirroring() +{ + # Create ImageTagMirrorSet to redirect Windows container images to CI registry + # Images are pre-mirrored via core-services/image-mirroring/_config.yaml + # This works for both connected Prow (registry.ci.openshift.org) and disconnected (ephemeral mirror) + + echo "Setting up ImageTagMirrorSet for Windows container images..." + + # Determine mirror registry based on environment + if [ -f "${SHARED_DIR}/mirror_registry_url" ]; then + # Disconnected environment with ephemeral mirror registry + MIRROR_REGISTRY_HOST=$(head -n 1 "${SHARED_DIR}/mirror_registry_url") + echo "Disconnected mode: Using ephemeral mirror registry at ${MIRROR_REGISTRY_HOST}" + else + # Connected Prow CI - use pre-mirrored images from CI registry + MIRROR_REGISTRY_HOST="registry.ci.openshift.org" + echo "Connected mode: Using pre-mirrored images from ${MIRROR_REGISTRY_HOST}" + fi + + # Create ImageTagMirrorSet to redirect Windows images to mirror + # Includes PowerShell containers and CSI driver images for storage tests + # PowerShell: Server 2019 (1809), Server 2022 (ltsc2022) + # CSI: Azure File and vSphere drivers for OCP-66352 + # TODO: Remove Server 2019 support after AMI/image upgrades to Server 2022 + cat <