-
Notifications
You must be signed in to change notification settings - Fork 71
✨ Add ReleaseVersionPriority feature gate for re-release upgrade support #2543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rashmigottipati
wants to merge
4
commits into
operator-framework:main
Choose a base branch
from
rashmigottipati:oprun-4277-implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+210
−3
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7a8ab66
Add ReleaseVersionPriority feature gate for re-release upgrade support
rashmigottipati 885f015
fix lint issues
rashmigottipati 6157202
add unit test for feature gate enabled
rashmigottipati 8dcab49
fix feature gat cleanup in ReleaseVersionPriority tests
rashmigottipati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import ( | |
|
|
||
| ocv1 "github.com/operator-framework/operator-controller/api/v1" | ||
| "github.com/operator-framework/operator-controller/internal/operator-controller/bundle" | ||
| "github.com/operator-framework/operator-controller/internal/operator-controller/features" | ||
| "github.com/operator-framework/operator-controller/internal/shared/util/filter" | ||
| ) | ||
|
|
||
|
|
@@ -28,11 +29,22 @@ func SuccessorsOf(installedBundle ocv1.BundleMetadata, channels ...declcfg.Chann | |
| return nil, fmt.Errorf("getting successorsPredicate: %w", err) | ||
| } | ||
|
|
||
| // We need either successors or current version (no upgrade) | ||
| return filter.Or( | ||
| // Build the final predicate based on feature gate status | ||
| predicates := []filter.Predicate[declcfg.Bundle]{ | ||
| successorsPredicate, | ||
| ExactVersionRelease(*installedVersionRelease), | ||
| ), nil | ||
| } | ||
|
|
||
| // If release version priority is enabled, also consider bundles | ||
| // with the same semantic version but higher release as valid successors. | ||
| // This allows upgrades to re-released bundles (e.g., 2.0.0+1 -> 2.0.0+2). | ||
|
Comment on lines
+38
to
+40
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if the re-release version is already in the explicit upgrade graph? In that case, should we ignore it and let its explicit channel entry take precedence? That would preserve existing behavior. |
||
| if features.OperatorControllerFeatureGate.Enabled(features.ReleaseVersionPriority) { | ||
| predicates = append(predicates, SameVersionHigherRelease(*installedVersionRelease)) | ||
| } | ||
rashmigottipati marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Bundle matches if it's a channel successor, current version (no upgrade), | ||
| // or (when feature gate enabled) same version with higher release | ||
| return filter.Or(predicates...), nil | ||
| } | ||
|
|
||
| func legacySuccessor(installedBundle ocv1.BundleMetadata, channels ...declcfg.Channel) (filter.Predicate[declcfg.Bundle], error) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest putting the
expectvalue in the test case, and adding cases that start from different values. For example: from a version without a release.Also related: do we need to add code that knows how to parse the new
Releasefield of theolm.packageproperty (around here:operator-controller/internal/operator-controller/bundleutil/bundle.go
Line 28 in dee8ed5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc, @grokspawn's design called for a specific precedence when handling both
releaseand build metadata that we will need to account for.