Skip to content

OPRUN-4598: dynamically resolve catalog image tag from OCP release version#750

Open
ankitathomas wants to merge 1 commit into
operator-framework:masterfrom
ankitathomas:dynamic-default-tags
Open

OPRUN-4598: dynamically resolve catalog image tag from OCP release version#750
ankitathomas wants to merge 1 commit into
operator-framework:masterfrom
ankitathomas:dynamic-default-tags

Conversation

@ankitathomas
Copy link
Copy Markdown
Contributor

Dynamically set default CatalogSource image tags to match the OpenShift cluster version (e.g., v4.23, v5.0) when RELEASE_VERSION is available.

Behavior:

  • Only affects default CatalogSources with tagged images
  • Preserves digest-based images and non-OpenShift deployments
  • Extracts major.minor from RELEASE_VERSION (4.23.0-rc.1 → v4.23)
  • Skips if RELEASE_VERSION is unset or "0.0.1-snapshot"
  • Only done once at startup for the set of default CatalogSources.

Assisted by: Claude

Description of the change:

Motivation for the change:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

Dynamically set default CatalogSource image tags to match the OpenShift
cluster version (e.g., v4.23, v5.0) when RELEASE_VERSION is available.

Behavior:
- Only affects default CatalogSources with tagged images
- Preserves digest-based images and non-OpenShift deployments
- Extracts major.minor from RELEASE_VERSION (4.23.0-rc.1 → v4.23)
- Skips if RELEASE_VERSION is unset or "0.0.1-snapshot"
- Only done once at startup for the set of default CatalogSources.

Assisted by: Claude
Signed-off-by: Ankita Thomas <ankithom@redhat.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 15, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@ankitathomas: This pull request references OPRUN-4598 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Dynamically set default CatalogSource image tags to match the OpenShift cluster version (e.g., v4.23, v5.0) when RELEASE_VERSION is available.

Behavior:

  • Only affects default CatalogSources with tagged images
  • Preserves digest-based images and non-OpenShift deployments
  • Extracts major.minor from RELEASE_VERSION (4.23.0-rc.1 → v4.23)
  • Skips if RELEASE_VERSION is unset or "0.0.1-snapshot"
  • Only done once at startup for the set of default CatalogSources.

Assisted by: Claude

Description of the change:

Motivation for the change:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

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 openshift-eng/jira-lifecycle-plugin repository.

@ankitathomas ankitathomas self-assigned this May 15, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign camilamacedo86 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link
Copy Markdown
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

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

My concern here is that this always seems to be overriding the tag with the value from RELEASE_VERSION. But we currently don't have 4.23 nor 5.0 catalogs available yet. Unless I'm missing something?

It seems to be that the OLMv1 mechanism ought to be followed; use a "special value" that gets written over. from RELEASE_VERSION. Such that if the reference is "v4.22", we remain using that catalog until it is changed to a value to be replaced.

The special value that was added seems to purposefully not replace the version with RELEASE_VERION.

Comment thread pkg/defaults/defaults.go
Comment on lines +170 to +172
if len(versionString) == 0 || versionString == defaultCatsrcVersionString {
return "", nil
}
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.

How could versionString == defaultCatsrcVersionString ever be true? This function is used at one point, and the value retrieved is from an environment variable, so it will likely be either "5.0.something" or "4.23.something".
So, I'm not sure what this part of the check is for?

It almost seems to me you want to override the value only if the existing version is defaultCatsrcVersionString, which you don't know about in this function. You know about that in the overrideImageTag function.

Copy link
Copy Markdown
Contributor Author

@ankitathomas ankitathomas May 20, 2026

Choose a reason for hiding this comment

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

It will be true for upstream, where CVO does not update the default RELEASE value for the marketplace operator to something besides 0.0.1-snapshot. The purpose of this special value is so that we don't break the marketplace-operator in case it runs on a cluster without CVO. If we see 0.0.1-snapshot, we use the default catalogs as they are, so for the current state of the catalogs they would use 4.22 as in

image: registry.redhat.io/redhat/redhat-operator-index:v4.22

This is based on

- name: "RELEASE_VERSION"
# The string "0.0.1-snapshot" is substituted by the CVO with the version of the payload
value: "0.0.1-snapshot"

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.

OK, so this is effectively an upstream-only check.

Comment thread pkg/defaults/defaults.go
@ankitathomas
Copy link
Copy Markdown
Contributor Author

/retest

@tmshort
Copy link
Copy Markdown
Contributor

tmshort commented May 20, 2026

This still seems to always override the catalog version with the RELEASE_VERSION variable. That's a problem because the v4.23 and v5.0 don't currently exist; so this will fail. As I suggested above, we should only swap in the RELEASE_VERSION when we're ready to do so (i.e. when those catalogs are ready). In OLMv1 we have a special ocp-release tag in the manifests that indicate, "yes, it's OK to replace this with the RELEASE_VERSION"

This is from the failed e2e-gcp test:

    state:
      waiting:
        message: 'Back-off pulling image "registry.redhat.io/redhat/certified-operator-index:v5.0":
          ErrImagePull: unable to pull image or OCI artifact: pull image err: initializing
          source docker://registry.redhat.io/redhat/certified-operator-index:v5.0:
          reading manifest v5.0 in registry.redhat.io/redhat/certified-operator-index:
          manifest unknown; artifact err: image reference: get manifest from ref:
          create image source: reading manifest v5.0 in registry.redhat.io/redhat/certified-operator-index:
          manifest unknown'
        reason: ImagePullBackOff

It's trying to load the v5.0 version of the catalog, which doesn't exist.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 2026

@ankitathomas: The following tests 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/prow/e2e-gcp-console-olm 6d839fc link true /test e2e-gcp-console-olm
ci/prow/e2e-gcp-ovn-upgrade 6d839fc link true /test e2e-gcp-ovn-upgrade
ci/prow/e2e-gcp 6d839fc link true /test e2e-gcp
ci/prow/e2e-aws-ovn-serial 6d839fc link true /test e2e-aws-ovn-serial

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants