Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions tests/e2e/common-operator-integ-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ initialize_variables() {
CI=${CI:-"false"}
USE_INTERNAL_REGISTRY=${USE_INTERNAL_REGISTRY:-"false"}
FIPS_CLUSTER=${FIPS_CLUSTER:-"false"}
COMMIT_HASH=$(git rev-parse --short HEAD)

# Debug logging and fallback for GINKGO_FLAGS
echo "CI environment: ${CI}"
Expand All @@ -148,16 +149,16 @@ initialize_variables() {
# Scenario 2: CI mode with default HUB -> use external registry with proper CI tag
echo "CI mode detected for OCP, using external registry ${HUB}"
export USE_INTERNAL_REGISTRY="false"
# Use PR_NUMBER if available, otherwise generate timestamp tag
# Use TARGET_ARCH to differentiate tags for different architectures in CI, avoid race conditions in CI when multiple runs are pushing to the same default tag
# Use PR_NUMBER and commit hash to identify the image, avoid race conditions in CI when multiple runs are pushing to the same default tag
# Use TARGET_ARCH to differentiate tags for different architectures in CI
if [ -n "${PR_NUMBER:-}" ]; then
TAG="pr-${PR_NUMBER}-${TARGET_ARCH}"
TAG="pr-${PR_NUMBER}-${COMMIT_HASH}-${TARGET_ARCH}"
export TAG
echo "Using PR-based tag: ${TAG}"
else
TAG="ci-test-$(date +%s)-${TARGET_ARCH}"
TAG="ci-test-${COMMIT_HASH}-${TARGET_ARCH}"
export TAG
echo "Using timestamp-based tag: ${TAG}"
echo "Using commit-based tag: ${TAG}"
fi
elif [ "${CI}" == "true" ]; then
# Additional CI mode check - handle CI mode regardless of HUB value
Expand Down Expand Up @@ -286,11 +287,18 @@ if [ "${SKIP_BUILD}" == "false" ]; then
fi
fi
# If OLM is enabled, deploy the operator using OLM
# We are skipping the deploy via OLM test on OCP because the workaround to avoid the certificate issue is not working.
# Jira ticket related to the limitation: https://issues.redhat.com/browse/OSSM-7993
if [ "${OLM}" == "true" ] && [ "${SKIP_DEPLOY}" == "false" ] && [ "${MULTICLUSTER}" == "false" ]; then
# If PR_NUMBER is set we will tag the BUNDLE_IMG with the PR number and commit hash to avoid conflicts.
if [ "${OLM}" == "true" ] && [ "${SKIP_DEPLOY}" == "false" ] && [ "${MULTICLUSTER}" == "false" ]; then
IMAGE_TAG_BASE="${HUB}/${IMAGE_BASE}"
BUNDLE_IMG="${IMAGE_TAG_BASE}-bundle:v${VERSION}"
if [ "${CI}" == "true" ]; then
if [ -n "${PR_NUMBER:-}" ]; then
BUNDLE_IMG="${IMAGE_TAG_BASE}-bundle:pr-${PR_NUMBER}-${COMMIT_HASH}-${TARGET_ARCH}"
else
BUNDLE_IMG="${IMAGE_TAG_BASE}-bundle:ci-test-${COMMIT_HASH}-${TARGET_ARCH}"
fi
else
BUNDLE_IMG="${IMAGE_TAG_BASE}-bundle:ci-test-${COMMIT_HASH}-${TARGET_ARCH}"
fi

IMAGE="${HUB}/${IMAGE_BASE}:${TAG}" \
IMAGE_TAG_BASE="${IMAGE_TAG_BASE}" \
Expand Down
Loading