-
Notifications
You must be signed in to change notification settings - Fork 64
🌱 Refactor rukpack package for configurable registry+v1 rendering behavior #1968
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
🌱 Refactor rukpack package for configurable registry+v1 rendering behavior #1968
Conversation
Signed-off-by: Per G. da Silva <[email protected]>
Signed-off-by: Per G. da Silva <[email protected]>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
a1bf48b
to
3a3380a
Compare
Signed-off-by: Per G. da Silva <[email protected]>
Signed-off-by: Per G. da Silva <[email protected]>
3a3380a
to
eae2c24
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1968 +/- ##
==========================================
- Coverage 69.01% 69.00% -0.02%
==========================================
Files 77 78 +1
Lines 6972 6979 +7
==========================================
+ Hits 4812 4816 +4
- Misses 1878 1883 +5
+ Partials 282 280 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -12,7 +12,7 @@ import ( | |||
rbacv1 "k8s.io/api/rbac/v1" | |||
"sigs.k8s.io/controller-runtime/pkg/client" | |||
|
|||
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/render/generators" | |||
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/render/registryv1/generators" |
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 think it is nice to allow more types
var isWebhookSupportEnabled bool | ||
if features.OperatorControllerFeatureGate.Enabled(features.WebhookProviderCertManager) { | ||
certProvider = certproviders.CertManagerCertificateProvider{} | ||
isWebhookSupportEnabled = true |
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 see you are trying to allow more options without bringing the complexity
If we enable the Webhook then automatically we either enable WebhookProviderCertManager
@@ -53,13 +54,15 @@ type Preflight interface { | |||
Upgrade(context.Context, *release.Release) error | |||
} | |||
|
|||
type BundleToHelmChartFn func(rv1 fs.FS, installNamespace string, watchNamespace string) (*chart.Chart, error) | |||
type BundleToHelmChartConverter interface { | |||
ToHelmChart(bundle source.BundleSource, installNamespace string, watchNamespace string) (*chart.Chart, error) |
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.
OK, so we are moving away to have a function to define a contract/interface to convert any BundleSource to a HelmChart.
For HelmChart, we’d skip the convert call anyway, right?
But for something like a registry/v2 source, having the interface could help.
Is that what you had in mind?
@@ -1,10 +0,0 @@ | |||
apiVersion: operators.operatorframework.io/v1alpha1 |
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.
Why did we remove the testdata samples?
Are we mocking in the tests directly?
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 found it 👍
bundlePathProperties: &fstest.MapFile{Data: []byte(strings.Trim(propertiesYml, "\n"))}, | ||
bundlePathCSV: &fstest.MapFile{Data: []byte(strings.Trim(csvYml, "\n"))}, | ||
} | ||
} |
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.
Here, I found the testdata removed 👍
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.
Hi @perdasilva 👋
Thanks for the PR!
The bulk of the changes seem to be moving things around to better support other bundle source types — that makes sense 👍
I did notice the addition of the flag for CertManager provider and how it's combined. Would it maybe make sense to split that into a separate PR? That way we could give it more focused attention, and if anything breaks downstream, it’s easier to revert. (That said, I’m not blocking this PR because of it.)
Overall, I don’t have any objections — nothing here looks like a blocker for me, so I’m OK with moving forward.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c9df915
into
operator-framework:main
Description
This PR refactors the rukpack/convert package to make it easier to configure registry+v1 conversion features like webhook and apiservice support by:
I decided not to add a controller-manager flag for toggling between cert providers. For now, let's rely on the FeatureGate values to do that. Once we have coalesced on default behavior we can start to think about this, I think. No need to add the complexity right now.
Reviewer Checklist