feat: extraManifests support#66
Conversation
📝 WalkthroughWalkthroughThis change adds support for injecting arbitrary Kubernetes manifests into the Helm chart via a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
charts/kafka-ui/templates/extra-manifests.yaml (1)
1-8: Consider guarding the template and cleaning up whitespace.A couple of minor polish items:
- When
.Values.extraObjectsis empty (the default), this template still renders a file containing only blank lines. That's harmless forhelm install, but it's cleaner to wrap the body in{{- if .Values.extraObjects }}so no output is produced at all.- Whitespace control is inconsistent (
{{ range }}vs{{- if }}), which leaves stray blank lines between documents. Using{{-/-}}consistently produces tidier rendered manifests, which helps when users inspecthelm templateoutput or diff rendered manifests.♻️ Suggested cleanup
-{{ range .Values.extraObjects }} ---- -{{- if typeIs "string" . }} -{{ tpl . $ }} -{{ else }} -{{ tpl (. | toYaml) $ }} -{{- end }} -{{ end }} +{{- if .Values.extraObjects }} +{{- range .Values.extraObjects }} +--- +{{- if typeIs "string" . }} +{{ tpl . $ }} +{{- else }} +{{ tpl (toYaml .) $ }} +{{- end }} +{{- end }} +{{- end }}Note: the YAMLlint error reported on line 3 is a false positive — it's attempting to parse Go template directives as YAML. Safe to ignore.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@charts/kafka-ui/templates/extra-manifests.yaml` around lines 1 - 8, Wrap the template body with a guard checking .Values.extraObjects (e.g., add an if around the existing {{ range .Values.extraObjects }} block) so nothing is emitted when extraObjects is empty, and normalize whitespace control by switching template delimiters to the trimmed form (use {{- and -}} consistently for {{ if }}, {{ range }}, and the end tags) so tpl and toYaml output don't leave stray blank lines between documents; update the {{ range .Values.extraObjects }}, {{- if ... }}, tpl and toYaml usages accordingly to produce no output when empty and tidier rendered manifests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@charts/kafka-ui/CONFIGURATION.md`:
- Line 15: Update the CONFIGURATION.md table entry for the extraObjects
parameter so its description matches values.yaml and is more precise: replace
"Arbitrary K8s resources" with wording like "Array of extra Kubernetes manifests
to deploy" (or "Arbitrary Kubernetes spec" if you prefer to mirror values.yaml
exactly). Ensure the change refers to the same parameter name extraObjects and,
if CONFIGURATION.md is generated from `@param` comments in values.yaml, update the
`@param` description in values.yaml instead to avoid future drift.
In `@charts/kafka-ui/values.yaml`:
- Around line 297-299: The extraObjects entry is placed under the implicit
Scheduling section but CONFIGURATION.md documents it under Common; move the
extraObjects: [] block (the parameter named extraObjects) into the Common
section or add an explicit section header (for example add a new "## `@section`
Extra Deploy" immediately before the extraObjects param) so the `@param/`@section
annotations match the documentation generator; update the surrounding
comment/annotation so the readme-generator will keep extraObjects in the
intended section.
---
Nitpick comments:
In `@charts/kafka-ui/templates/extra-manifests.yaml`:
- Around line 1-8: Wrap the template body with a guard checking
.Values.extraObjects (e.g., add an if around the existing {{ range
.Values.extraObjects }} block) so nothing is emitted when extraObjects is empty,
and normalize whitespace control by switching template delimiters to the trimmed
form (use {{- and -}} consistently for {{ if }}, {{ range }}, and the end tags)
so tpl and toYaml output don't leave stray blank lines between documents; update
the {{ range .Values.extraObjects }}, {{- if ... }}, tpl and toYaml usages
accordingly to produce no output when empty and tidier rendered manifests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e10caade-acbc-4657-8eab-b46e7a7676b0
📒 Files selected for processing (4)
charts/kafka-ui/CONFIGURATION.mdcharts/kafka-ui/Chart.yamlcharts/kafka-ui/templates/extra-manifests.yamlcharts/kafka-ui/values.yaml
this allow to declare arbitraty kubernetes resources. Fixes kafbat#57
e1e3f11 to
5fd8fca
Compare
this allows to declare arbitrary kubernetes resources.
Fixes #57
Summary by CodeRabbit
New Features
extraManifestsparameter enabling users to deploy arbitrary Kubernetes resources through Helm chart configuration values. This provides flexible resource management without requiring direct template modifications.Documentation
extraManifestsparameter.