Skip to content

OCPSTRAT-2876: Allow inclusion/exclusion of manifests based on the OCP major version#1282

Open
JoelSpeed wants to merge 1 commit intoopenshift:mainfrom
JoelSpeed:major-version-inclusion
Open

OCPSTRAT-2876: Allow inclusion/exclusion of manifests based on the OCP major version#1282
JoelSpeed wants to merge 1 commit intoopenshift:mainfrom
JoelSpeed:major-version-inclusion

Conversation

@JoelSpeed
Copy link
Contributor

@JoelSpeed JoelSpeed commented Dec 24, 2025

This introduces a new CVO manifest filter based on the OCP major version.

The intended usage would allow folks to say "this manifest should be deployed on OCP 5 and skipped on OCP 4"

The library-go component here is limiting this feature to FeatureGate and CustomResourceDefinition only for now.

This is not intended for use beyond the feature gating mechanisms we have today. We expect FeatureGate and CustomResourceDefinition yamls to vary by release, but all other inclusion/exclusion should be handled by existing mechanisms like the feature-gate inclusion mechanism.

Example usage:

release.openshift.io/major-version: 5,6,7

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 24, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 24, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link

coderabbitai bot commented Dec 24, 2025

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JoelSpeed
Once this PR has been reviewed and has the lgtm label, please assign davidhurta 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

@JoelSpeed JoelSpeed force-pushed the major-version-inclusion branch 2 times, most recently from 39354c8 to ef0e8c6 Compare January 30, 2026 12:20
@JoelSpeed JoelSpeed changed the title [WIP] Allow inclusion/exclusion of manifests based on the OCP major version [WIP] OCPSTRAT-2876: Allow inclusion/exclusion of manifests based on the OCP major version Jan 30, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 30, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 30, 2026

@JoelSpeed: This pull request references OCPSTRAT-2876 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 feature to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Currently based on #1273

TODO

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.

@JoelSpeed JoelSpeed force-pushed the major-version-inclusion branch from ef0e8c6 to 2d6aae6 Compare February 4, 2026 18:07
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 4, 2026

@JoelSpeed: This pull request references OCPSTRAT-2876 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 feature to target the "4.22.0" version, but no target version was set.

Details

In response to this:

This introduces a new CVO manifest filter based on the OCP major version.

The intended usage would allow folks to say "this manifest should be deployed on OCP 5 and skipped on OCP 4"

The library-go component here is limiting this feature to FeatureGate and CustomResourceDefinition only for now.

This is not intended for use beyond the feature gating mechanisms we have today. We expect FeatureGate and CustomResourceDefinition yamls to vary by release, but all other inclusion/exclusion should be handled by existing mechanisms like the feature-gate inclusion mechanism.

Example usage:

release.openshift.io/major-version: 5,6,7

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.

@JoelSpeed JoelSpeed changed the title [WIP] OCPSTRAT-2876: Allow inclusion/exclusion of manifests based on the OCP major version OCPSTRAT-2876: Allow inclusion/exclusion of manifests based on the OCP major version Feb 4, 2026
@JoelSpeed JoelSpeed marked this pull request as ready for review February 4, 2026 18:20
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 4, 2026
@JoelSpeed
Copy link
Contributor Author

@DavidHurta If you are available, I'd appreciate if you could help me with this feature as well

@DavidHurta
Copy link
Contributor

@JoelSpeed, I will be happy to assist.

/cc

@openshift-ci openshift-ci bot requested a review from DavidHurta February 4, 2026 21:39
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 4, 2026

@JoelSpeed: 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-aws-ovn-techpreview 2d6aae6 link true /test e2e-aws-ovn-techpreview
ci/prow/lint 2d6aae6 link true /test lint

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.

Copy link
Contributor

@DavidHurta DavidHurta left a comment

Choose a reason for hiding this comment

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

The PR looks solid!

A few comments about a thing here or there, but nothing drastic.
The overall functionality is 👍

ImageRef *imagev1.ImageStream

Architecture string
MajorVersion *uint64
Copy link
Contributor

@DavidHurta DavidHurta Feb 12, 2026

Choose a reason for hiding this comment

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

Here, the purpose of MajorVersion is starting to become a bit fuzzy in comparison to the Release.Version field. The meaning of MajorVersion in the inclusion filtering context is clear; however, here we use it in a general struct type representing the contents of a release image. Thus, their purpose becomes less clear.

We could do one of the following:

  • Document MajorVersion field to make the difference between Release.Version and MajorVersion clearer.
  • Leave only one source of truth (that is, Release.Version), and extract the major version when needed using a function.
  • Create a new field ParsedVersion semver.Version; we could use it to get access to the parsed cached version of the update easily. This could even be utilized in the future when we need easy access to the parsed version of an update, which is more handy for fine grained processing. This would bring additional value to the new field, make it more general, and make its distinction clearer. The call sites requiring the MajorVersion would need to be updated to just ptr.To(payload.ParsedVersion.Major), so it would still be readable. I am more inclined towards this approach, but I am curious what you think.

return requiredFeatureSet, enabledFeatureGates, nil
}

func loadReleaseVersion(releaseDir string) (semver.Version, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we start to duplicate some logic. I am curious whether we could leverage the existing loadReleaseMetadata function here instead of manually loading the release version.

The loadReleaseMetadata function also contains some additional validation, such as:

	if metadata.Kind != "cincinnati-metadata-v0" {
		return release, fmt.Errorf("unrecognized Cincinnati metadata kind %q", metadata.Kind)
	}

Copy link
Contributor

Choose a reason for hiding this comment

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

Something like:

func loadReleaseVersion(releaseDir string) (semver.Version, error) {
	release, err := loadReleaseMetadata(releaseDir)
	if err != nil {
		return semver.Version{}, err
	}

	parsedVersion, err := semver.Parse(release.Version)
	if err != nil {
		return semver.Version{}, err
	}
	return parsedVersion, nil
}

}
}

func TestRenderDirWithMajorVersionFiltering(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment not related to the selected line


Thank you for the complex testing of the rendering!

The overall testing coverage of the PR is solid. However, we do not have an integration test to determine whether the CVO will actually apply the manifest based on the major version. I am doubtful whether this feature will receive end-to-end tests. Thus, I think it would be beneficial to increase the test coverage to ensure that the CVO truly does respect the major version when loading and applying manifests, WDYT?

Something like: DavidHurta@ee1907b

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