OCPSTRAT-2876: Manifest inclusion filtering based on major version#2069
Conversation
|
Skipping CI for Draft Pull Request. |
e409b04 to
6f6c4ca
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JoelSpeed The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
aeb7ced to
0cba804
Compare
|
@JoelSpeed is this PR still relevant ? |
|
It is yes I was having some back and forth last week with @wking and @everettraven about how we want this to look. I'm currently pausing on this for the moment while i focus on getting the CVO feature gate annotation work wrapped. But this is on the requirements list for 5.0 so I'll come back to this soon |
73e3e1c to
6e5ccfd
Compare
6e5ccfd to
6f4c21d
Compare
|
@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. DetailsIn response to this:
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. |
ok, sgtm, please let me know when it is ready for review. |
|
/approve /hold I’m adding a hold so you can test the changes in the operator, if you haven’t already. |
|
/hold cancel I think we have enough consensus to move this forward |
|
@JoelSpeed: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
| { | ||
| name: "nil major version should include all", | ||
| annotations: map[string]string{"release.openshift.io/major-version": "4"}, | ||
| clusterMajorVersion: nil, |
| expectedErrorContains: "major version 4 does not match any required versions", | ||
| }, | ||
| { | ||
| name: "multiple inclusions - first matches", |
| expectIncluded: true, | ||
| }, | ||
| { | ||
| name: "multiple inclusions - middle matches", |
| expectIncluded: true, | ||
| }, | ||
| { | ||
| name: "multiple inclusions - last matches", |
| expectedErrorContains: "invalid excluded major version \"abc\" in annotation: strconv.ParseUint: parsing \"abc\": invalid syntax", | ||
| }, | ||
| { | ||
| name: "zero version", |
| } | ||
|
|
||
| // TestMajorVersionFilteringInteractionWithOtherFilters tests that major version filtering works alongside other filters | ||
| func TestMajorVersionFilteringInteractionWithOtherFilters(t *testing.T) { |
| case includedVersions.Has(clusterMajorVersion): | ||
| return nil // Found matching version, include this manifest | ||
| case excludedVersions.Has(clusterMajorVersion): | ||
| return fmt.Errorf("major version %d matches excluded version %d", clusterMajorVersion, clusterMajorVersion) |
There was a problem hiding this comment.
It seems the second variable in the error string should be excludedVersions.
I got logs:
2026-03-19T03:56:10.602708782Z I0319 03:56:10.602688 1 payload.go:217] excluding Filename: "0000_03_version-4-5-6-false.yaml" Group: "apiextensions.k8s.io" Kind: "CustomResourceDefinition" Name: "version-4-5-6.test.io": major version 4 matches excluded version 4
@JoelSpeed please help condifrm.
There was a problem hiding this comment.
I think it is actually correct. From the case condition we know that the clusterMajorVersion is in the excludedVersions set, so even if we tried to change this to print out the excluded versions, it would just show us a list of excluded versions rather than a specific excluded version that matched.
The error message that is printed out is always correct, the 4 here was an excluded version
There was a problem hiding this comment.
um, it looks strange, but anyway from the message we can know the version is excluded
Currently based on #2067
This teaches the manifest inclusion to filter based on a major-version annotation. This will allow us to concurrently build multiple major versions from a single branch while folks can include manifests (in particular feature gates) that apply only to 4, or 5, or 6 etc