Skip to content

⭐️ Improve Helm chart management and cleanup#1374

Merged
chris-rock merged 3 commits intomainfrom
helm-chart-improvements
Feb 12, 2026
Merged

⭐️ Improve Helm chart management and cleanup#1374
chris-rock merged 3 commits intomainfrom
helm-chart-improvements

Conversation

@chris-rock
Copy link
Copy Markdown
Member

@chris-rock chris-rock commented Feb 5, 2026

Summary

This PR addresses #849 and #821 by improving Helm chart management and adding proper cleanup on uninstall.

Changes

  • Pre-delete hook: Cleans up MondooAuditConfig resources before uninstall, allowing finalizers to run properly
  • Cleanup subcommand: Added mondoo-operator cleanup CLI command (replaces external kubectl image dependency)
  • Hand-maintained templates: Replaced helmify-based generation with hand-maintained Helm templates
  • CRD update script: Added hack/update-helm-crds.sh to update only CRDs from generated sources
  • Chart-testing in CI: Added ct lint to CI pipeline and Makefile
  • Helm integration tests: Added test suite for Helm chart validation
  • Chart icon: Added Mondoo logo to Helm chart
  • Lint integration: helm/lint is now included in the default make lint target

Why

  1. Supply chain security: The cleanup hook now uses the operator's own image instead of a third-party bitnami/kubectl image
  2. Maintainability: Hand-maintained templates are easier to modify and don't require post-processing hacks
  3. Reliability: Pre-delete hook ensures proper cleanup when running helm uninstall

New Make Targets

make helm/crds              # Update CRDs from generated sources
make helm/lint              # Lint with chart-testing (ct)
make helm/template          # Render templates for debugging
make test/integration/helm  # Run Helm integration tests

Test plan

  • make helm/lint passes
  • helm template renders correctly
  • Code compiles (go build ./...)
  • Integration tests pass
  • Manual test: helm install / helm uninstall cycle

Fixes #849, Fixes #821

@chris-rock chris-rock force-pushed the helm-chart-improvements branch from 038688a to bf1e7ec Compare February 5, 2026 17:24
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2026

Test Results

  5 files  ± 0   43 suites  +1   39m 30s ⏱️ + 1m 23s
354 tests + 6  354 ✅ + 6  0 💤 ±0  0 ❌ ±0 
394 runs  +24  392 ✅ +24  2 💤 ±0  0 ❌ ±0 

Results for commit 71f1621. ± Comparison against base commit 784a806.

♻️ This comment has been updated with latest results.

@chris-rock chris-rock force-pushed the helm-chart-improvements branch 4 times, most recently from 806c832 to 54fca28 Compare February 6, 2026 16:30
imilchev
imilchev previously approved these changes Feb 12, 2026
chris-rock and others added 3 commits February 12, 2026 20:40
- Add pre-delete hook to clean up MondooAuditConfig resources on uninstall
- Add cleanup subcommand to operator CLI (replaces external kubectl image)
- Replace helmify-based chart generation with hand-maintained templates
- Add hack/update-helm-crds.sh script to update only CRDs from generated sources
- Add chart-testing (ct) linting to CI and Makefile
- Add Mondoo icon to Helm chart
- Add Helm chart integration tests

The cleanup hook now uses the operator's own image instead of a third-party
kubectl image, eliminating a supply chain dependency.

Fixes #849, Fixes #821

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…RD script

- Add hook-failed to cleanup Job's hook-delete-policy so failed jobs
  don't block subsequent helm install attempts
- Remove unused webhook ServiceAccount and values (webhooks removed in v12.1.0)
- Add validation step to update-helm-crds.sh to catch silent sed failures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chris-rock chris-rock force-pushed the helm-chart-improvements branch from 54fca28 to 71f1621 Compare February 12, 2026 19:43
@chris-rock chris-rock merged commit 6166e68 into main Feb 12, 2026
25 checks passed
@chris-rock chris-rock deleted the helm-chart-improvements branch February 12, 2026 22:03
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Helm installation less error prone Find new way to create Helm chart

2 participants