Skip to content

Fix kueue upgrade test using stale operand image - #81517

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
sohankunkerkar:fix-upgrade-operand-image
Jul 7, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
sohankunkerkar:fix-upgrade-operand-image

Conversation

@sohankunkerkar

@sohankunkerkar sohankunkerkar commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

Summary

  • The kueue upgrade test fallback path patches the operator image in the CSV but not the operand image
  • The ImageDigestMirrorSet cannot redirect because Konflux and registry.redhat.io produce different digests, so the operand always falls back to the old production image (April 2026)
  • This causes AFS and preemption e2e tests to fail on every upgrade CI run

Fix:

  • Resolve the latest Konflux-built operand image in image-env-setup (same pattern as the bundle resolution)
  • Patch RELATED_IMAGE_OPERAND_IMAGE in the CSV during the fallback path so the operator deploys the correct operand

Unblocks openshift/kueue-operator#2134

Test plan

  • Rehearsal upgrade job passes with the correct operand image in oc get deployment -n openshift-kueue-operator -o wide
  • AFS consumedResources.cpu > 0 (no longer stuck at zero)
  • Preemption FairSharing ConfigMap propagation succeeds

🤖 Generated with Claude Code

Summary by CodeRabbit

This PR fixes the Kueue operator upgrade CI fallback logic in the OpenShift release CI by ensuring the upgrade test deploys the correct operand image (not a stale production digest). In ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh, the step now resolves the latest Konflux-built OPERAND_IMAGE and BUNDLE_IMAGE (using a helper that selects the newest 40-hex digest tag) and exports both into ${SHARED_DIR}/env for downstream steps.

In ci-operator/step-registry/kueue-operator/test/upgrade/operator/kueue-operator-test-upgrade-operator-commands.sh, when the bundle install fallback path runs, the script patches the upgraded CSV to replace the operator container image with ${OPERATOR_IMAGE} and—when ${OPERAND_IMAGE} is set—also patches the RELATED_IMAGE_OPERAND_IMAGE env entry to ${OPERAND_IMAGE}. This prevents the operand from incorrectly reverting to an older April 2026 image during upgrade e2e runs, unblocking the affected upgrade CI jobs.

Copilot AI review requested due to automatic review settings July 6, 2026 18:53
@openshift-ci
openshift-ci Bot requested review from kannon92 and mrunalp July 6, 2026 18:53
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 6, 2026
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: f8271d37-8eb4-423a-814c-8bea1e67cc1c

📥 Commits

Reviewing files that changed from the base of the PR and between 8e2cce4132beef22b5e529ae1d81ac788286633a and e18818e.

📒 Files selected for processing (2)
  • ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh
  • ci-operator/step-registry/kueue-operator/test/upgrade/operator/kueue-operator-test-upgrade-operator-commands.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh
  • ci-operator/step-registry/kueue-operator/test/upgrade/operator/kueue-operator-test-upgrade-operator-commands.sh

Walkthrough

This PR updates the kueue-operator image setup script to resolve and export operand and bundle images from the latest matching tags, and extends the upgrade fallback script to patch the operand-related CSV environment variable when present.

Changes

Kueue operator image resolution and upgrade patching

Layer / File(s) Summary
Image resolution setup
ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh
Adds resolve_latest_image() to select the newest 40-hex-tagged image by Created, then uses it to resolve and export OPERAND_IMAGE and BUNDLE_IMAGE with failure exits when either lookup is empty.
Upgrade CSV patching
ci-operator/step-registry/kueue-operator/test/upgrade/operator/kueue-operator-test-upgrade-operator-commands.sh
Keeps the operator image patch in the fallback path and adds optional patching of RELATED_IMAGE_OPERAND_IMAGE to ${OPERAND_IMAGE}, exiting when the env entry is missing.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
    participant Script as image-env-setup script
    participant Skopeo
    participant Env as SHARED_DIR/env

    Script->>Skopeo: list-tags(repo)
    Skopeo-->>Script: tag list
    Script->>Skopeo: inspect matching 40-hex tags
    Skopeo-->>Script: Created timestamps
    Script->>Env: export OPERAND_IMAGE
    Script->>Env: export BUNDLE_IMAGE
Loading
sequenceDiagram
    participant Test as upgrade test script
    participant CSV as Installed CSV
    participant API as Cluster API

    Test->>CSV: select installed CSV
    Test->>API: patch operator image to OPERATOR_IMAGE
    Test->>CSV: find RELATED_IMAGE_OPERAND_IMAGE env index
    alt env index found
        Test->>API: patch operand env value to OPERAND_IMAGE
    else env index missing
        Test->>Test: exit with error
    end
Loading
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing the kueue upgrade test by resolving and using the latest operand image.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed No Ginkgo test titles were added or modified; the PR only changes shell step scripts, so there are no unstable test names to flag.
Test Structure And Quality ✅ Passed PASS: This PR only changes ci-operator shell step scripts, not Ginkgo It blocks; the scripts add explicit timeouts, cleanup, and failure checks.
Microshift Test Compatibility ✅ Passed PASS: PR only changes ci-operator shell step scripts; no new Ginkgo tests or MicroShift-unsupported APIs/resources were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests were added or changed; only CI shell scripts for image resolution and CSV patching were modified.
Topology-Aware Scheduling Compatibility ✅ Passed The PR only changes shell scripts for image resolution/CSV patching; it adds no pod affinity, node selectors, replica logic, tolerations, or topology constraints.
Ote Binary Stdout Contract ✅ Passed Only ci-operator shell step scripts changed; no OTE binary process-level code (main/TestMain/RunSpecs setup) was added or modified.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR only changes CI shell step scripts; no new or modified Ginkgo It/Describe/Context tests were added, so the IPv6/disconnected-test check is not applicable.
No-Weak-Crypto ✅ Passed Changed scripts only resolve container images with skopeo/jq and patch CSV env vars; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons found.
Container-Privileges ✅ Passed Only shell scripts changed; no container/K8s manifests were modified, and the new operator-sdk invocation uses --security-context-config restricted.
No-Sensitive-Data-In-Logs ✅ Passed Logs only print image refs, status, and repo metadata; no passwords, tokens, PII, internal hostnames, or customer data are exposed.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the kueue-operator upgrade CI fallback path so that, when operator-sdk run bundle fails, the test run patches both the operator image and the operand image reference in the installed CSV—preventing upgrades from unintentionally using an older production operand image.

Changes:

  • Resolve the latest Konflux-built operand image in kueue-operator-image-env-setup and export it to ${SHARED_DIR}/env.
  • In the manual upgrade fallback path, patch RELATED_IMAGE_OPERAND_IMAGE in the CSV (in addition to patching the operator container image).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ci-operator/step-registry/kueue-operator/test/upgrade/operator/kueue-operator-test-upgrade-operator-commands.sh Extends CSV patching in the fallback path to also update the operand related image env var.
ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh Adds operand image resolution (same pattern as bundle) and exports OPERAND_IMAGE for downstream steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The upgrade test fallback path patches the operator image in the CSV
but not the operand image. The ImageDigestMirrorSet cannot redirect
because Konflux and registry.redhat.io produce different digests,
so the operand always falls back to the old production image.

Resolve the latest Konflux-built operand image in image-env-setup and
patch RELATED_IMAGE_OPERAND_IMAGE in the CSV during the fallback path.
@sohankunkerkar
sohankunkerkar force-pushed the fix-upgrade-operand-image branch from 8e2cce4 to e18818e Compare July 6, 2026 19:01
@sohankunkerkar

Copy link
Copy Markdown
Member Author

/test

@sohankunkerkar

Copy link
Copy Markdown
Member Author

/test all

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@sohankunkerkar: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-kueue-operator-release-1.3-upgrade-from-4.18-e2e-ocp-upgrade-4-18-to-4-19-kueue-1-3 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.3-upgrade-from-4.20-e2e-ocp-upgrade-4-20-to-4-21-kueue-1-3 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.22-e2e-operator-upgrade-4-22-kueue-1-3-to-1-4 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.3-upgrade-from-4.19-e2e-ocp-upgrade-4-19-to-4-20-kueue-1-3 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.20-e2e-ocp-upgrade-4-20-to-4-21-kueue-1-4 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.20-e2e-operator-upgrade-4-20-kueue-1-3-to-1-4 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.19-e2e-ocp-upgrade-4-19-to-4-20-kueue-1-4 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.19-e2e-operator-upgrade-4-19-kueue-1-3-to-1-4 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.21-e2e-ocp-upgrade-4-21-to-4-22-kueue-1-4 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.21-e2e-operator-upgrade-4-21-kueue-1-3-to-1-4 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.18-e2e-ocp-upgrade-4-18-to-4-19-kueue-1-4 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.18-e2e-operator-upgrade-4-18-kueue-1-3-to-1-4 openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-main-perfscale-pr-kueue-operator-9nodes openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.4-perfscale-pr-kueue-operator-9nodes openshift/kueue-operator presubmit Registry content changed
pull-ci-openshift-kueue-operator-release-1.3-perfscale-pr-kueue-operator-9nodes openshift/kueue-operator presubmit Registry content changed
periodic-ci-openshift-kueue-operator-release-1.4-test-e2e-upstream-4-20 N/A periodic Registry content changed
periodic-ci-openshift-kueue-operator-release-1.4-test-e2e-upstream-4-22 N/A periodic Registry content changed
periodic-ci-openshift-kueue-operator-main-test-e2e-downstream-4-22 N/A periodic Registry content changed
periodic-ci-openshift-kueue-operator-main-test-e2e-dra-gpu-4-21 N/A periodic Registry content changed
periodic-ci-openshift-kueue-operator-release-1.3-test-e2e-upstream-4-21 N/A periodic Registry content changed
periodic-ci-openshift-kueue-operator-main-test-e2e-4-18 N/A periodic Registry content changed
periodic-ci-openshift-kueue-operator-release-1.4-test-e2e-4-18 N/A periodic Registry content changed
periodic-ci-openshift-kueue-operator-release-1.4-perfscale-kueue-operator-9nodes N/A periodic Registry content changed
periodic-ci-openshift-kueue-operator-main-test-e2e-4-21-arm64 N/A periodic Registry content changed
periodic-ci-openshift-kueue-operator-release-1.3-test-e2e-downstream-4-21 N/A periodic Registry content changed

A total of 56 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs.

A full list of affected jobs can be found here

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@sohankunkerkar

Copy link
Copy Markdown
Member Author

/pj-rehearse pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.21-e2e-operator-upgrade-4-21-kueue-1-3-to-1-4

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@sohankunkerkar: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@sohankunkerkar

Copy link
Copy Markdown
Member Author

/pj-rehearse pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.20-e2e-ocp-upgrade-4-20-to-4-21-kueue-1-4

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@sohankunkerkar: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh (1)

34-56: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff

resolve_latest_image does one skopeo inspect call per matching tag — O(n) network round trips.

Called twice (for OPERAND_IMAGE and BUNDLE_IMAGE), this sequentially inspects every 40-hex-char tag in each repo to find the newest Created timestamp. If either repo accumulates many historical digest tags, this can meaningfully slow down the step and increase flakiness from transient registry calls (each inspect failure is silently swallowed via 2>/dev/null, potentially skipping the true latest tag if it briefly errors).

Consider using a registry/Quay API call that returns tags with metadata in one request (sorted by last-modified) instead of N sequential skopeo inspect calls, to reduce both latency and flakiness.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh`
around lines 34 - 56, The resolve_latest_image helper is doing one skopeo
inspect per digest tag, which makes OPERAND_IMAGE and BUNDLE_IMAGE resolution
slow and flaky. Replace the per-tag inspection loop in resolve_latest_image with
a single registry/Quay API lookup that can return tags with metadata or ordering
in one request, then select the newest candidate from that response. Keep the
OPERAND_REPO and BUNDLE_REPO callers unchanged, but make the image resolution
logic avoid sequential network round trips and silent inspect failures.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh`:
- Around line 36-39: The resolve_latest_image pipeline currently fails early
when grep finds no 40-char hex tags, so the OPERAND_IMAGE assignment aborts
before the existing empty-result check can report the intended diagnostic.
Update resolve_latest_image in kueue-operator-image-env-setup-commands.sh to
tolerate an empty tag match set inside the function, either by guarding the grep
stage or otherwise preventing pipefail from short-circuiting, so the caller can
reach the existing error handling and message.

In
`@ci-operator/step-registry/kueue-operator/test/upgrade/operator/kueue-operator-test-upgrade-operator-commands.sh`:
- Around line 48-56: The fallback in the operator upgrade script can crash when
the CSV container has no env array because the jq pipeline in the OPERAND_IMAGE
lookup iterates over .env unconditionally. Update the ENV_INDEX extraction in
kueue-operator-test-upgrade-operator-commands.sh to safely handle a missing or
null env field (for example, by defaulting to an empty array before
to_entries[]) so the command substitution in the OPERAND_IMAGE block yields an
empty result instead of failing; keep the existing if [[ -n "${ENV_INDEX}" ]]
guard in place to skip patching when RELATED_IMAGE_OPERAND_IMAGE is absent.

---

Nitpick comments:
In
`@ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh`:
- Around line 34-56: The resolve_latest_image helper is doing one skopeo inspect
per digest tag, which makes OPERAND_IMAGE and BUNDLE_IMAGE resolution slow and
flaky. Replace the per-tag inspection loop in resolve_latest_image with a single
registry/Quay API lookup that can return tags with metadata or ordering in one
request, then select the newest candidate from that response. Keep the
OPERAND_REPO and BUNDLE_REPO callers unchanged, but make the image resolution
logic avoid sequential network round trips and silent inspect failures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: a9fc91ed-ee56-4170-8732-ea6be5e7d1d7

📥 Commits

Reviewing files that changed from the base of the PR and between 66a5a9a and 8e2cce4132beef22b5e529ae1d81ac788286633a.

📒 Files selected for processing (2)
  • ci-operator/step-registry/kueue-operator/image-env-setup/kueue-operator-image-env-setup-commands.sh
  • ci-operator/step-registry/kueue-operator/test/upgrade/operator/kueue-operator-test-upgrade-operator-commands.sh

@sohankunkerkar

Copy link
Copy Markdown
Member Author

/pj-rehearse ack

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@sohankunkerkar: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Jul 7, 2026
@sohankunkerkar

Copy link
Copy Markdown
Member Author

The rehearsal job confirms the operand image patching works fine. There's a circular deps with openshift/kueue-operator#2134

@PannagaRao

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2026
@openshift-ci

openshift-ci Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: PannagaRao, sohankunkerkar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@sohankunkerkar: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/rehearse/openshift/kueue-operator/release-1.4/upgrade-from-4.21-e2e-operator-upgrade-4-21-kueue-1-3-to-1-4 e18818e link unknown /pj-rehearse pull-ci-openshift-kueue-operator-release-1.4-upgrade-from-4.21-e2e-operator-upgrade-4-21-kueue-1-3-to-1-4

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit eb35ef3 into openshift:main Jul 7, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants