Skip to content

🐛 OCPBUGS-95281: add HelmChartSupport to Boxcutter backend#2797

Closed
pedjak wants to merge 1 commit into
operator-framework:mainfrom
pedjak:ocpbugs-95281-helmchart-boxcutter
Closed

🐛 OCPBUGS-95281: add HelmChartSupport to Boxcutter backend#2797
pedjak wants to merge 1 commit into
operator-framework:mainfrom
pedjak:ocpbugs-95281-helmchart-boxcutter

Conversation

@pedjak

@pedjak pedjak commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

When BoxcutterRuntime=true (default in experimental install), the HelmChartSupport feature gate is accepted but has no effect. Installing a helm chart from an OCI registry via a ClusterExtension fails with open metadata/annotations.yaml: no such file or directory because the Boxcutter backend always assumes registryv1 bundle format.

This PR adds helm chart detection and rendering to SimpleRevisionGenerator.GenerateRevision(), gated behind the existing HelmChartSupport feature gate:

  • Detect helm chart bundles via IsBundleSourceChart() before falling back to the registryv1 path
  • Render chart templates using Helm's engine.Render() (pure template rendering, no cluster access needed)
  • Include CRDs from the chart's crds/ directory
  • Filter out non-manifest templates (NOTES.txt, helpers) by extension and helm hooks by annotation
  • Detect install vs upgrade from extension status for correct .Release.IsInstall/.Release.IsUpgrade template values
  • Use chart's values.yaml defaults for template rendering

Reviewer Checklist

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

Copilot AI review requested due to automatic review settings July 1, 2026 15:20
@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 Jul 1, 2026
@openshift-ci

openshift-ci Bot commented Jul 1, 2026

Copy link
Copy Markdown

[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 kevinrizza for approval. For more information see the Code Review Process.

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

Details 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

@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit ba6b647
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6a454b3d45ebb50008e38811
😎 Deploy Preview https://deploy-preview-2797--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Helm chart bundle detection/rendering to the Boxcutter revision generation path so HelmChartSupport actually affects behavior when BoxcutterRuntime=true, enabling ClusterExtension installs from OCI Helm charts (including CRDs and hook/template filtering).

Changes:

  • Gate Helm chart detection in SimpleRevisionGenerator.GenerateRevision() and render templates via Helm’s engine when a chart bundle is detected.
  • Extend e2e catalog-building/test plumbing to support packaging a chart directory into a .tgz “bundle” and add an e2e scenario + minimal chart testdata.
  • Add unit coverage for chart-path rendering, filtering, and feature-gate behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/operator-controller/applier/boxcutter.go Detect chart bundles under HelmChartSupport, render templates/CRDs, filter hooks/non-manifests, and build a ClusterObjectSet from rendered objects.
internal/operator-controller/applier/boxcutter_test.go Add unit tests covering Helm chart rendering path, feature-gate behavior, filtering, and values handling.
test/internal/catalog/bundle.go Add support for packaging a Helm chart directory into a .tgz bundle artifact for e2e catalog usage.
test/internal/catalog/catalog.go Avoid applying registryv1 bundle OCI labels for Helm-chart bundles in test catalog image creation.
test/e2e/steps/steps.go Allow specifying a chart column in catalog tables to package a chart into a bundle for e2e runs.
test/e2e/features/install.feature Add an e2e scenario that installs a Helm chart from a catalog under Boxcutter runtime.
test/e2e/steps/testdata/charts/helm-test/Chart.yaml Minimal Helm chart metadata for the new e2e scenario.
test/e2e/steps/testdata/charts/helm-test/templates/configmap.yaml Minimal templated manifest validating .Release / .Chart values during rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/internal/catalog/bundle.go
Comment thread test/internal/catalog/bundle.go Outdated
Comment thread internal/operator-controller/applier/boxcutter_test.go
Comment thread test/e2e/steps/steps.go
Comment on lines +1590 to +1599
headerCols := make(map[string]int)
for i, cell := range table.Rows[0].Cells {
headerCols[strings.ToLower(cell.Value)] = i
}
cellVal := func(rowIdx int, name string) string {
if idx, ok := headerCols[name]; ok && idx < len(table.Rows[rowIdx].Cells) {
return table.Rows[rowIdx].Cells[idx].Value
}
return ""
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged — the header-based parsing replaces the previous positional parsing which also had no validation. Adding required-header validation is a good idea but out of scope for this bug fix.

@pedjak pedjak force-pushed the ocpbugs-95281-helmchart-boxcutter branch from 654ca51 to ac66840 Compare July 1, 2026 16:12
@pedjak pedjak marked this pull request as ready for review July 1, 2026 16:13
Copilot AI review requested due to automatic review settings July 1, 2026 16:13
@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 Jul 1, 2026
@pedjak pedjak requested review from perdasilva and tmshort and removed request for oceanc80 July 1, 2026 16:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment on lines +130 to +135
if features.OperatorControllerFeatureGate.Enabled(features.HelmChartSupport) {
meta := new(chart.Metadata)
if ok, _ := imageutil.IsBundleSourceChart(bundleFS, meta); ok {
return r.generateRevisionFromChart(ctx, bundleFS, ext, meta, objectLabels, revisionAnnotations)
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The ok, _ := pattern matches the Helm backend (helm.go:253) — it's a consistent design choice, not a new regression. IsBundleSourceChart is lightweight (one ReadDir + one ReadFile), so the cost on non-chart bundles is minimal.

Comment thread internal/operator-controller/applier/boxcutter.go Outdated
When BoxcutterRuntime=true (default in experimental install),
installing helm charts via ClusterExtension fails because
SimpleRevisionGenerator.GenerateRevision() always delegates to
RegistryV1ManifestProvider, which expects metadata/annotations.yaml.

Add helm chart detection and rendering to GenerateRevision(), gated
behind the HelmChartSupport feature gate. When a helm chart bundle is
detected via IsBundleSourceChart(), render templates using Helm's
engine.Render() (pure template rendering, no cluster access), include
CRDs from the crds/ directory, filter out non-manifest files (.tpl,
NOTES.txt) by extension and helm hooks by annotation, and detect
install vs upgrade from the extension status.

Co-Authored-By: Claude <noreply@anthropic.com>
@pedjak pedjak force-pushed the ocpbugs-95281-helmchart-boxcutter branch from ac66840 to ba6b647 Compare July 1, 2026 17:15
@joelanford

Copy link
Copy Markdown
Member

Seems to me like a heavy maintenance burden to take on this code in the boxcutter path, especially when the path forward on the next bundle format is not clear and may not even be helm.

I propose we solve this bug by crashing the program when both feature gates are enabled and documenting their mutual exclusivity.

I'd also be amenable to fully removing the code related to helm support since I think we'd want to revisit it again in earnest with a broader design (catalog implications, pipeline implications, lifecycling implications with boxcutter, etc.)

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.

3 participants