Skip to content
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

⚠️ (Partially) fix upgrade behaviour in Extension #759

Merged

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Apr 17, 2024

Description

With the current code there are a few issues:

  1. catalogfilter.HigherBundleVersion is not really required as we already have more generic catalogfilter.InMastermindsSemverRange.
  2. I think catalogfilter.HigherBundleVersion allows upgrades from one major version to another major version, etc. This is not the same behaviour as in ClusterExtension
  3. We do not seem to support legacy replaces here.

This PR solves the first two, but the third still needs to be addressed.

How it currently works in ClusterExtension: https://github.com/operator-framework/operator-controller/blob/52cb7eb1a650731f2e16253a7f0f0ba25ea3af70/docs/drafts/upgrade-support.md

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@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 Apr 17, 2024
Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit d73541f
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/661fa28c7973e4000801e275
😎 Deploy Preview https://deploy-preview-759--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -204,7 +204,7 @@ func TestExtensionResolve(t *testing.T) {
extNN := types.NamespacedName{Name: ext.GetName(), Namespace: ext.GetNamespace()}

res, reconcileErr := reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: extNN})
assert.Equal(t, reconcileErr, tc.wantErr)
assert.Equal(t, tc.wantErr, reconcileErr)
Copy link
Member Author

Choose a reason for hiding this comment

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

Should be expected and then actual.

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 67.90%. Comparing base (52cb7eb) to head (d73541f).

Files Patch % Lines
internal/controllers/extension_controller.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #759      +/-   ##
==========================================
- Coverage   68.15%   67.90%   -0.26%     
==========================================
  Files          22       22              
  Lines        1429     1424       -5     
==========================================
- Hits          974      967       -7     
- Misses        390      391       +1     
- Partials       65       66       +1     
Flag Coverage Δ
e2e 46.34% <0.00%> (+0.16%) ⬆️
unit 61.94% <50.00%> (-0.29%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m1kola m1kola changed the title 🌱 Remove HigherBundleVersion predicate ⚠️ (Partially) fix upgrade behaviour in Extension Apr 17, 2024
* `HigherBundleVersion` allows upgrades which are not allowed in `ClusterExtension`.
  For example, it is possible to ugprade `Extension` from one major version to another.
* Existing `InMastermindsSemverRange` can be used instead
  reducing the amount of code to maintain a bit.

Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
@m1kola m1kola force-pushed the remove_HigherBundleVersion_predicate branch from 00afa62 to d73541f Compare April 17, 2024 10:20
@m1kola m1kola marked this pull request as ready for review April 17, 2024 11:40
@m1kola m1kola requested a review from a team as a code owner April 17, 2024 11:40
@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 Apr 17, 2024
Copy link
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.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2024
@tmshort tmshort added this pull request to the merge queue Apr 17, 2024
Merged via the queue into operator-framework:main with commit e079129 Apr 17, 2024
15 of 17 checks passed
@m1kola m1kola deleted the remove_HigherBundleVersion_predicate branch April 24, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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