From 5862239157030d315af927fe21372c30d4dca379 Mon Sep 17 00:00:00 2001 From: Francisco Herrera Date: Mon, 2 Feb 2026 17:40:05 +0100 Subject: [PATCH 1/2] Adding some fix for midstream CI execution Signed-off-by: Francisco Herrera --- tests/e2e/common-operator-integ-suite.sh | 12 +++++++++++- tests/e2e/integ-suite-kind.sh | 4 ++-- tests/e2e/integ-suite-ocp.sh | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/e2e/common-operator-integ-suite.sh b/tests/e2e/common-operator-integ-suite.sh index d717c6e768..2a0364af41 100755 --- a/tests/e2e/common-operator-integ-suite.sh +++ b/tests/e2e/common-operator-integ-suite.sh @@ -126,6 +126,16 @@ initialize_variables() { ISTIO_MANIFEST="chart/samples/istio-sample.yaml" CI=${CI:-"false"} + # Debug logging and fallback for GINKGO_FLAGS + echo "CI environment: ${CI}" + echo "GINKGO_FLAGS received: '${GINKGO_FLAGS:-}'" + + # Fallback: Generate GINKGO_FLAGS if empty and CI=true + if [ -z "${GINKGO_FLAGS:-}" ] && [ "${CI}" == "true" ]; then + GINKGO_FLAGS="--no-color" + echo "Generated GINKGO_FLAGS fallback: '${GINKGO_FLAGS}'" + fi + # export to be sure that the variables are available in the subshell export IMAGE_BASE="${IMAGE_BASE:-sail-operator}" export TAG="${TAG:-latest}" @@ -304,7 +314,7 @@ if [ "${SKIP_BUILD}" == "false" ]; then fi fi -export SKIP_DEPLOY IP_FAMILY ISTIO_MANIFEST NAMESPACE CONTROL_PLANE_NS DEPLOYMENT_NAME MULTICLUSTER ARTIFACTS ISTIO_NAME COMMAND KUBECONFIG ISTIOCTL_PATH SKIP_CLEANUP +export SKIP_DEPLOY IP_FAMILY ISTIO_MANIFEST NAMESPACE CONTROL_PLANE_NS DEPLOYMENT_NAME MULTICLUSTER ARTIFACTS ISTIO_NAME COMMAND KUBECONFIG ISTIOCTL_PATH SKIP_CLEANUP GINKGO_FLAGS if [ "${OLM}" != "true" ] && [ "${SKIP_DEPLOY}" != "true" ]; then # shellcheck disable=SC2153 diff --git a/tests/e2e/integ-suite-kind.sh b/tests/e2e/integ-suite-kind.sh index f796ad3bd4..29cd3427c7 100755 --- a/tests/e2e/integ-suite-kind.sh +++ b/tests/e2e/integ-suite-kind.sh @@ -35,10 +35,10 @@ function check_prerequisites() { function run_integration_tests() { echo "Running integration tests" if [ "${MULTICLUSTER}" == "true" ]; then - ARTIFACTS="${ARTIFACTS}" ISTIOCTL="${ISTIOCTL}" "${ROOT}/tests/e2e/common-operator-integ-suite.sh" --kind --multicluster + ARTIFACTS="${ARTIFACTS}" ISTIOCTL="${ISTIOCTL}" GINKGO_FLAGS="${GINKGO_FLAGS}" "${ROOT}/tests/e2e/common-operator-integ-suite.sh" --kind --multicluster else KUBECONFIG="${ARTIFACTS}/config" - ARTIFACTS="${ARTIFACTS}" IP_FAMILY="${IP_FAMILY}" "${ROOT}/tests/e2e/common-operator-integ-suite.sh" --kind + ARTIFACTS="${ARTIFACTS}" IP_FAMILY="${IP_FAMILY}" GINKGO_FLAGS="${GINKGO_FLAGS}" "${ROOT}/tests/e2e/common-operator-integ-suite.sh" --kind fi } diff --git a/tests/e2e/integ-suite-ocp.sh b/tests/e2e/integ-suite-ocp.sh index 83566be1a2..a075dd2692 100755 --- a/tests/e2e/integ-suite-ocp.sh +++ b/tests/e2e/integ-suite-ocp.sh @@ -27,4 +27,4 @@ if [ -z "${KUBECONFIG}" ]; then exit 1 fi -KUBECONFIG="${KUBECONFIG}" ./tests/e2e/common-operator-integ-suite.sh --ocp \ No newline at end of file +KUBECONFIG="${KUBECONFIG}" GINKGO_FLAGS="${GINKGO_FLAGS}" ./tests/e2e/common-operator-integ-suite.sh --ocp \ No newline at end of file From 5688d26aadf7e808957dc8396daf03fda061b45c Mon Sep 17 00:00:00 2001 From: Francisco Herrera Date: Tue, 3 Feb 2026 19:05:12 +0100 Subject: [PATCH 2/2] Forcing avoid the use of external registry when CI mode is detected Adding a new variable to handle properly the case Signed-off-by: Francisco Herrera --- tests/e2e/common-operator-integ-suite.sh | 10 ++++++++++ tests/e2e/setup/build-and-push-operator.sh | 3 +++ 2 files changed, 13 insertions(+) diff --git a/tests/e2e/common-operator-integ-suite.sh b/tests/e2e/common-operator-integ-suite.sh index 2a0364af41..f2fa8f6497 100755 --- a/tests/e2e/common-operator-integ-suite.sh +++ b/tests/e2e/common-operator-integ-suite.sh @@ -125,6 +125,7 @@ initialize_variables() { IP_FAMILY=${IP_FAMILY:-ipv4} ISTIO_MANIFEST="chart/samples/istio-sample.yaml" CI=${CI:-"false"} + USE_INTERNAL_REGISTRY=${USE_INTERNAL_REGISTRY:-"false"} # Debug logging and fallback for GINKGO_FLAGS echo "CI environment: ${CI}" @@ -144,9 +145,13 @@ initialize_variables() { # Handle OCP registry scenarios # Note: Makefile.core.mk sets HUB=quay.io/sail-dev and TAG=1.29-latest by default if [ "${OCP}" == "true" ]; then + # Debug output for troubleshooting + echo "DEBUG: CI='${CI}', HUB='${HUB}'" + if [ "${CI}" == "true" ] && [ "${HUB}" == "quay.io/sail-dev" ]; then # 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 if [ -n "${PR_NUMBER:-}" ]; then @@ -157,9 +162,14 @@ initialize_variables() { export TAG echo "Using timestamp-based tag: ${TAG}" fi + elif [ "${CI}" == "true" ]; then + # Additional CI mode check - handle CI mode regardless of HUB value + echo "CI mode detected for OCP with custom HUB (${HUB}), using external registry" + export USE_INTERNAL_REGISTRY="false" elif [ "${HUB}" != "quay.io/sail-dev" ]; then # Scenario 3: Custom registry provided by user echo "Using custom registry: ${HUB}" + export USE_INTERNAL_REGISTRY="false" else # Scenario 1: Local development -> use internal OCP registry echo "Local development mode, will use OCP internal registry" diff --git a/tests/e2e/setup/build-and-push-operator.sh b/tests/e2e/setup/build-and-push-operator.sh index fadc990c83..4be9123fa6 100755 --- a/tests/e2e/setup/build-and-push-operator.sh +++ b/tests/e2e/setup/build-and-push-operator.sh @@ -86,9 +86,12 @@ build_and_push_operator_image() { # Main logic # Only use internal registry for OCP local development (when USE_INTERNAL_REGISTRY is set) +echo "DEBUG: OCP='${OCP}', USE_INTERNAL_REGISTRY='${USE_INTERNAL_REGISTRY:-false}'" if [ "${OCP}" == "true" ] && [ "${USE_INTERNAL_REGISTRY:-false}" == "true" ]; then echo "Setting up OCP internal registry for local development..." get_internal_registry +else + echo "Skipping internal registry setup - using external registry" fi echo "Registry: ${HUB}"