Skip to content

Conversation

anik120
Copy link
Contributor

@anik120 anik120 commented Aug 26, 2025

Introduce BundleConfig that contains InstallConfig and DeploymentConfig.

Description

Reviewer Checklist

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

@anik120 anik120 requested a review from a team as a code owner August 26, 2025 15:34
Copy link

netlify bot commented Aug 26, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 7b919f4
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/68ae0b331a75eb0008cd5956
😎 Deploy Preview https://deploy-preview-2166--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 project configuration.

@openshift-ci openshift-ci bot requested review from bentito and grokspawn August 26, 2025 15:34
@anik120 anik120 changed the title ✨ (rukpak) extend bundle renderer to accept config opts ✨ OPRUN-4090: (rukpak) extend bundle renderer to accept config opts Aug 26, 2025
@anik120 anik120 force-pushed the registryv1-renderer-config-support branch 2 times, most recently from 3577b5b to cb7ab21 Compare August 26, 2025 15:44
Copy link

openshift-ci bot commented Aug 26, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign thetechnick for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

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

Copy link

codecov bot commented Aug 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.92%. Comparing base (dff07d5) to head (7b919f4).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2166      +/-   ##
==========================================
+ Coverage   72.79%   72.92%   +0.13%     
==========================================
  Files          79       79              
  Lines        7340     7410      +70     
==========================================
+ Hits         5343     5404      +61     
- Misses       1651     1659       +8     
- Partials      346      347       +1     
Flag Coverage Δ
e2e 44.29% <45.45%> (-0.14%) ⬇️
experimental-e2e 54.76% <45.45%> (-0.21%) ⬇️
unit 58.62% <100.00%> (+0.38%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@anik120 anik120 force-pushed the registryv1-renderer-config-support branch 2 times, most recently from d4af9f8 to f26e1fa Compare August 26, 2025 15:56
Introduce BundleConfig that contains InstallConfig and DeploymentConfig.
@anik120 anik120 force-pushed the registryv1-renderer-config-support branch from f26e1fa to 7b919f4 Compare August 26, 2025 19:29
Comment on lines +250 to +252
case !allSupported && !singleSupported && !ownSupported:
// no All, no Single, no Own: invalid bundle
errs = append(errs, fmt.Errorf("invalid bundle: no supported install modes"))
Copy link
Member

@joelanford joelanford Aug 26, 2025

Choose a reason for hiding this comment

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

This case might be confusing for users if there are operators that support only MultiNamespace install mode.

Maybe we should have a multiSupported variable and a new case for "only multiSupported", so that we can explicitly say in this function that "operators supporting only MultiNamespace install mode are not supported by OLMv1".

We might somehow preclude that elsewhere, but if we do, it seems like we should consolidate the installModes + targetNamespaces support into this function.

And then finally this case would be augmented to include !multiSupported, at which point "invalid bundle: no supported install modes" makes more sense.

WatchNamespace: "test-namespace",
},
expectedErr: "watchNamespace configuration parameter is not supported for bundles that only support OwnNamespace install mode",
},
Copy link
Member

Choose a reason for hiding this comment

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

Related to my other comment: add a test case with the following?

installModes: []v1alpha1.InstallModeType{v1alpha1.InstallModeTypeMultiNamespace}

case allSupported && !singleSupported && ownSupported:
// All, no Single, Own: watchNamespace is optional (must == install namespace when set)
if config.WatchNamespace != "" && config.WatchNamespace != installNamespace {
errs = append(errs, fmt.Errorf("watchNamespace must equal install namespace (%s) when set for bundles supporting AllNamespaces and OwnNamespace install modes", installNamespace))
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Up for debate, but my instinct for clarity is to structure these error messages like this:

"bundle <bundleName> supports install modes <supportedInstallModes>: watchNamespace must be <allowedValues>"

NOTE: If the bundle name is already in some higher level error context as we return this error up the stack, then no need to repeat it here.

Suggested change
errs = append(errs, fmt.Errorf("watchNamespace must equal install namespace (%s) when set for bundles supporting AllNamespaces and OwnNamespace install modes", installNamespace))
errs = append(errs, fmt.Errorf("bundle %q supports install modes [AllNamespaces, OwnNamespace]; watchNamespace must be unset or equal to the install namespace (%q)", bundle.Name, installNamespace))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants