diff --git a/.github/workflows/emailsender-central-compatibility.yaml b/.github/workflows/emailsender-central-compatibility.yaml index 84ceb333c7..6f4aed4e90 100644 --- a/.github/workflows/emailsender-central-compatibility.yaml +++ b/.github/workflows/emailsender-central-compatibility.yaml @@ -17,6 +17,9 @@ on: - 'deploy/charts/emailsender/**' - 'scripts/**' - '.github/workflows/emailsender-central-compatibility.yaml' +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true jobs: e2e-test-on-kind: @@ -29,10 +32,6 @@ jobs: contents: read environment: development steps: - - name: Cancel Previous Runs - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Go uses: actions/setup-go@v6 with: @@ -55,7 +54,7 @@ jobs: with: path: acs-fleet-manager fetch-depth: 0 - - name: Create Kind cluster" + - name: Create Kind cluster uses: helm/kind-action@v1 with: cluster_name: kind diff --git a/scripts/ci/central_compatibility/run_compatibility_test.sh b/scripts/ci/central_compatibility/run_compatibility_test.sh index 0151f9ea21..32947414bc 100755 --- a/scripts/ci/central_compatibility/run_compatibility_test.sh +++ b/scripts/ci/central_compatibility/run_compatibility_test.sh @@ -20,7 +20,8 @@ source "$ROOT_DIR/dev/env/scripts/lib.sh" function pull_to_kind() { local img=$1 - local retry="${2:-5}" + local imgname=$2 + local retry="${3:-5}" local backoff=30 for _ in $(seq "$retry"); do @@ -31,11 +32,17 @@ function pull_to_kind() { sleep "$backoff" done - kind load docker-image "${img}" + docker save --platform amd64 "$img" -o "$IMG_TAR_DIR/$imgname.tar" + kind load image-archive "$IMG_TAR_DIR/$imgname.tar" } make --no-print-directory -C "$ROOT_DIR" image/build/emailsender -kind load docker-image "$(make --no-print-directory -C "$ROOT_DIR" image-tag/emailsender)" + +IMG_TAR_DIR="$(mktemp -d)" + +EMAILSENDER_IMAGE="$(make --silent --no-print-directory -C "$ROOT_DIR" image-tag/emailsender)" +docker save --platform amd64 "$EMAILSENDER_IMAGE" -o "$IMG_TAR_DIR/emailsender.tar" +kind load image-archive "$IMG_TAR_DIR/emailsender.tar" kubectl create ns $EMAILSENDER_NS -o yaml --dry-run=client | kubectl apply -f - kubectl create ns $CENTRAL_NS -o yaml --dry-run=client | kubectl apply -f - @@ -51,7 +58,7 @@ GITHUB_REPOSITORY=${GITHUB_REPOSITORY:-stackrox/acs-fleet-manager} log "Running for repository: $GITHUB_REPOSITORY" if [ "$GITHUB_REPOSITORY" = "stackrox/stackrox" ]; then STACKROX_DIR="$(cd "$ROOT_DIR/../stackrox" && pwd)" - ACS_VERSION="$(make --no-print-directory -C "$STACKROX_DIR" tag)" + ACS_VERSION="$(make --silent --no-print-directory -C "$STACKROX_DIR" tag)" else ACS_VERSION="$(git ls-remote --tags https://github.com/stackrox/stackrox | grep -E '.*-nightly-[0-9]{8}$' | awk '{print $2}' | sed 's|refs/tags/||' | sort -V | tail -n 1)" fi @@ -59,21 +66,18 @@ fi log "ACS version: $ACS_VERSION" IMG_REPO="quay.io/rhacs-eng" -MAIN_IMG_NAME="$IMG_REPO/main" -CENTRAL_DB_IMG_NAME="$IMG_REPO/central-db" - -IMAGES_TO_PULL=( - "$MAIN_IMG_NAME:$ACS_VERSION" - "$CENTRAL_DB_IMG_NAME:$ACS_VERSION" +IMG_NAMES=( + "main" + "central-db" ) - +MAIN_IMG="$IMG_REPO/main:$ACS_VERSION" IMG_WAIT_TIMEOUT_SECONDS="${IMG_WAIT_TIMEOUT_SECONDS:-1200}" -for img in "${IMAGES_TO_PULL[@]}"; do - wait_for_img "$img" "$IMG_WAIT_TIMEOUT_SECONDS" - pull_to_kind "$img" +for imgname in "${IMG_NAMES[@]}"; do + wait_for_img "$IMG_REPO/$imgname:$ACS_VERSION" "$IMG_WAIT_TIMEOUT_SECONDS" + pull_to_kind "$IMG_REPO/$imgname:$ACS_VERSION" "$imgname" done -ROXCTL="docker run --rm --user $(id -u):$(id -g) -v $(pwd):/tmp/stackrox-charts/ $MAIN_IMG_NAME:$ACS_VERSION" +ROXCTL="docker run --rm --user $(id -u):$(id -g) -v $(pwd):/tmp/stackrox-charts/ $MAIN_IMG" # --remove to make this script rerunnable on a local machine $ROXCTL helm output central-services --image-defaults opensource --remove --output-dir /tmp/stackrox-charts/central-chart