Fixed statefulset and volumeClaimTemplates render#1274
Conversation
|
@tuteng:Thanks for your contribution. For this PR, do we need to update docs? |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Helm templates for the sn-platform and sn-platform-slim charts to prevent invalid/undesired rendering of statefulSet customization and volumeClaimTemplates, especially when optional values are unset or persistence is disabled.
Changes:
- ZooKeeper: render
volumeClaimTemplatesonly when persistence is enabled while adopting an existing cluster, and adjust indentation for the included template. - Broker: render the
statefulSetcustomization block when any of TLS mounts, extra mounts, or extra PVC templates are configured; rendervolumeClaimTemplatesonly when claim templates are provided. - Apply the same logic to both
sn-platformandsn-platform-slim.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml | Guard ZooKeeper volumeClaimTemplates under persistence/adopt-existing and adjust include indentation. |
| charts/sn-platform/templates/broker/broker-cluster.yaml | Gate broker statefulSet rendering and only emit volumeClaimTemplates when configured. |
| charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml | Mirror ZooKeeper rendering fixes from sn-platform. |
| charts/sn-platform-slim/templates/broker/broker-cluster.yaml | Mirror broker rendering fixes from sn-platform. |
Comments suppressed due to low confidence (2)
charts/sn-platform/templates/broker/broker-cluster.yaml:392
- The new
ifguard aroundstatefulSet:is not indented underapiObjects:like the surrounding template blocks (compare to thepdbandproxychart patterns). This makes the template harder to read and can introduce subtle whitespace-trimming/rendering issues with{{- ... }}. Indent this conditional (and its matchingend) to the same level as otherapiObjectschildren.
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts .Values.broker.extraVolumeClaimTemplates }}
statefulSet:
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts }}
volumeMounts:
{{- include "pulsar.broker.certs.volumeMounts" . | nindent 6 }}
charts/sn-platform-slim/templates/broker/broker-cluster.yaml:392
- The new
ifguard aroundstatefulSet:is not indented underapiObjects:like the surrounding template blocks (compare to thepdbandproxychart patterns). This makes the template harder to read and can introduce subtle whitespace-trimming/rendering issues with{{- ... }}. Indent this conditional (and its matchingend) to the same level as otherapiObjectschildren.
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts .Values.broker.extraVolumeClaimTemplates }}
statefulSet:
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts }}
volumeMounts:
{{- include "pulsar.broker.certs.volumeMounts" . | nindent 6 }}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
(If this PR fixes a github issue, please add
Fixes #<xyz>.)Fixes #
(or if this PR is one task of a github issue, please add
Master Issue: #<xyz>to link to the master issue.)Master Issue: #
Motivation
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Describe the modifications you've done.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Documentation
Check the box below.
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-doc(Please explain why)
doc(If this PR contains doc changes)