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

⚠️ Only allow bundles with AllNamespaces install mode #924

Closed

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Jun 12, 2024

Description

TBD

Closes #816

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 Jun 12, 2024
Copy link

netlify bot commented Jun 12, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 90be17c
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/66699ce7fbe9500008a77eec
😎 Deploy Preview https://deploy-preview-924--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.

@m1kola m1kola force-pushed the test_non_AllNamespaces_bundles branch from 28dae5c to 90be17c Compare June 12, 2024 13:04
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.38%. Comparing base (66a063b) to head (90be17c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #924   +/-   ##
=======================================
  Coverage   77.38%   77.38%           
=======================================
  Files          17       17           
  Lines        1163     1163           
=======================================
  Hits          900      900           
  Misses        183      183           
  Partials       80       80           
Flag Coverage Δ
e2e 57.17% <100.00%> (ø)
unit 50.98% <0.00%> (ø)

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.

@@ -37,3 +37,29 @@ func TestClusterExtensionPackagesWithWebhooksAreNotAllowed(t *testing.T) {
assert.Equal(ct, &ocv1alpha1.BundleMetadata{Name: "package-with-webhooks.1.0.0", Version: "1.0.0"}, clusterExtension.Status.ResolvedBundle)
}, pollDuration, pollInterval)
}

func TestClusterExtensionPackagesWithUnsupportedInstallModesAreNotAllowed(t *testing.T) {
Copy link
Member

@joelanford joelanford Jun 12, 2024

Choose a reason for hiding this comment

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

Is there a way to put this in a unit test of the ClusterExtension reconciler instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

@joelanford I started working on this (and another test above TestClusterExtensionPackagesWithWebhooksAreNotAllowed) when rukpak was a separate thing running in the cluster with unpacker and all that complicated setup.

The idea was that we have an e2e test which helps us verify current limitations. I was hoping that this test will also help with the helm/rukpak integration into operator-controller. But it got blocked by helm/rukpak integration :)

I do not think that we can test it on ClusterExtension reconciler: rukpak stuff is mocked there.

We can probably test it on this level with a fake FS, but at this point I'm not sure how useful it will be.

Now that we use rukpak as a library - we should probably treat it as such: assume that this stuff if well tested on the rukpak side and do not double test on operator controller.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Now that we use rukpak as a library - we should probably treat it as such: assume that this stuff if well tested on the rukpak side and do not double test on operator controller.

I think with @varshaprasad96 's change in #928, where the actual call to convert the bundle happens fully in rukpak, I agree.

@@ -24,7 +25,7 @@ const (
)

func HandleClusterExtension(_ context.Context, fsys fs.FS, ext *ocv1alpha1.ClusterExtension) (*chart.Chart, chartutil.Values, error) {
plainFS, err := convert.RegistryV1ToPlain(fsys, ext.Spec.InstallNamespace, nil)
plainFS, err := convert.RegistryV1ToPlain(fsys, ext.Spec.InstallNamespace, []string{metav1.NamespaceAll})
Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like we no longer needs this fix because we no longer have it in operator-controller since #928

@m1kola
Copy link
Member Author

m1kola commented Jun 14, 2024

Closing as obsolete: we no longer need this fix #928. Also as discussed in #924 (comment) we do not want to double test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests to confirm that registry+v1 bundles with with install mode other than AllNamespaces are not allowed
2 participants