Skip to content

fix: skip stale registry.ci ocp spec in OfficialImageTagFrom#5222

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
deepsm007:fix-import
Jun 2, 2026
Merged

fix: skip stale registry.ci ocp spec in OfficialImageTagFrom#5222
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
deepsm007:fix-import

Conversation

@deepsm007
Copy link
Copy Markdown
Contributor

@deepsm007 deepsm007 commented Jun 1, 2026

https://redhat-internal.slack.com/archives/CBN38N3MW/p1780243383859199

/cc @openshift/test-platform

Fix: Skip Stale Registry.CI OCP Spec in OfficialImageTagFrom

Component affected: Image resolution utility in ci-operator (pkg/steps/utils/)

What changed: The OfficialImageTagFrom function now skips stale OCP image references from the internal registry.ci registry (registry.ci.openshift.org/ocp/*) when resolving official image tag sources. The function checks both the spec and status image stream tags, but only returns them if they are either non-DockerImage types OR DockerImage references that don't point to the internal OCP registry. When a spec or status tag references a stale internal registry.ci OCP image, the function falls back to using a Quay-based image reference instead.

Why it matters: ci-operator uses OfficialImageTagFrom to resolve image sources for official OCP images during CI test setup. The internal registry.ci is temporary and images there can become outdated or unavailable. By filtering out these stale internal references, the system automatically falls back to Quay, which hosts the canonical, actively-maintained OCP images. This prevents CI job failures caused by attempting to pull from obsolete or deprecated internal registries and ensures jobs use current, reliable image sources.

Testing: Added test case "skip stale registry.ci ocp spec" that verifies when an image stream tag's spec contains a DockerImage reference to registry.ci.openshift.org/ocp/*, that reference is correctly skipped and the function returns a Quay-based reference instead.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci openshift-ci Bot requested a review from a team June 1, 2026 15:33
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

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: db303a5b-fba7-410f-96d9-40454a9ff785

📥 Commits

Reviewing files that changed from the base of the PR and between c0d6794 and bdf3144.

📒 Files selected for processing (2)
  • pkg/steps/utils/image.go
  • pkg/steps/utils/image_test.go

📝 Walkthrough

Walkthrough

This PR modifies OfficialImageTagFrom to filter out stale DockerImage references from the deprecated registry.ci.openshift.org/ocp/ registry. When the spec-tag From reference points to this registry, the function now falls back to status-based resolution. A new test case validates this filtering behavior by asserting that stale registry sources are skipped in favor of Quay-derived references.

Changes

OCP Registry Image Filtering

Layer / File(s) Summary
OfficialImageTagFrom spec filter with test coverage
pkg/steps/utils/image.go, pkg/steps/utils/image_test.go
OfficialImageTagFrom adds a conditional guard excluding DockerImage sources with the api.ServiceDomainAPPCIRegistry+"/ocp/" prefix; it falls back to status resolution when this condition is met. A new test case "skip stale registry.ci ocp spec" validates this skip-and-fallback behavior by asserting that stale registry sources resolve to Quay-based references from status.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • openshift/ci-tools#5217: Both PRs modify the official OCP input resolution path in pkg/steps/utils/image.go's OfficialImageTagFrom behavior, refining how specific From references are accepted or skipped.

Suggested labels

approved, lgtm

Suggested reviewers

  • bear-redhat
  • smg247
🚥 Pre-merge checks | ✅ 16 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (16 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: filtering out stale registry.ci OCP spec references in the OfficialImageTagFrom function.
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.
Go Error Handling ✅ Passed All error handling patterns follow Go best practices: errors wrapped with fmt.Errorf/%w, nil pointer checks before dereferencing, panic only in init(), blank identifiers justified.
Test Coverage For New Features ✅ Passed Bug fix includes proper regression test: new "skip stale registry.ci ocp spec" case validates that stale registry.ci refs are filtered and Quay refs used instead.
Stable And Deterministic Test Names ✅ Passed New test case "skip stale registry.ci ocp spec" uses a static, descriptive string with no dynamic values, timestamps, UUIDs, pod names, or generated identifiers.
Test Structure And Quality ✅ Passed The PR adds a table-driven test case to standard Go testing (not Ginkgo). Check is not applicable to non-Ginkgo tests, so it passes.
Microshift Test Compatibility ✅ Passed The PR adds changes to a standard Go unit test file (using testing package), not Ginkgo e2e tests. This check does not apply to unit tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR modifies utility code and standard Go unit tests, not Ginkgo e2e tests. SNO compatibility check applies only to e2e tests with Ginkgo constructs (It/Describe/Context).
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies image reference resolution utility functions only. No deployment manifests, operator code, controllers, or scheduling constraints are introduced.
Ote Binary Stdout Contract ✅ Passed No OTE Binary Stdout Contract violations found. The init() function in image_test.go uses panic(), which writes to stderr (safe). All logrus calls are inside functions, not at module initialization.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies only standard Go unit tests in image_test.go, not Ginkgo e2e tests. No It(), Describe(), Context(), or When() patterns found. Check is not applicable.
No-Weak-Crypto ✅ Passed No weak cryptographic algorithms, custom crypto implementations, or insecure secret comparisons detected. Changes involve image registry path filtering using standard string operations.
Container-Privileges ✅ Passed PR contains only Go source code changes (image.go, image_test.go). No Kubernetes manifests, container specs, or privileged configurations present.
No-Sensitive-Data-In-Logs ✅ Passed PR introduces no new logging that exposes sensitive data. Changes are control-flow filters in OfficialImageTagFrom and test additions with non-sensitive error logging.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 1, 2026
@deepsm007
Copy link
Copy Markdown
Contributor Author

/test checkconfig e2e

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@jcpowermac
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 2, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepsm007, jcpowermac

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

@deepsm007
Copy link
Copy Markdown
Contributor Author

/override ci/prow/images

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 2, 2026

@deepsm007: Overrode contexts on behalf of deepsm007: ci/prow/images

Details

In response to this:

/override ci/prow/images

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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 2, 2026

@deepsm007: all tests passed!

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 b35f1f1 into openshift:main Jun 2, 2026
17 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants