Skip to content

Fixed statefulset and volumeClaimTemplates render#1274

Open
tuteng wants to merge 1 commit intomasterfrom
fixed/update-statefulset-render
Open

Fixed statefulset and volumeClaimTemplates render#1274
tuteng wants to merge 1 commit intomasterfrom
fixed/update-statefulset-render

Conversation

@tuteng
Copy link
Copy Markdown
Member

@tuteng tuteng commented May 9, 2026

(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

  • Make sure that the change passes the CI checks.

(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:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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)

Copilot AI review requested due to automatic review settings May 9, 2026 00:30
@tuteng tuteng requested review from a team as code owners May 9, 2026 00:30
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

@tuteng:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions github-actions Bot added the doc-info-missing This pr needs to mark a document option in description label May 9, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 volumeClaimTemplates only when persistence is enabled while adopting an existing cluster, and adjust indentation for the included template.
  • Broker: render the statefulSet customization block when any of TLS mounts, extra mounts, or extra PVC templates are configured; render volumeClaimTemplates only when claim templates are provided.
  • Apply the same logic to both sn-platform and sn-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 if guard around statefulSet: is not indented under apiObjects: like the surrounding template blocks (compare to the pdb and proxy chart patterns). This makes the template harder to read and can introduce subtle whitespace-trimming/rendering issues with {{- ... }}. Indent this conditional (and its matching end) to the same level as other apiObjects children.
{{- 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 if guard around statefulSet: is not indented under apiObjects: like the surrounding template blocks (compare to the pdb and proxy chart patterns). This makes the template harder to read and can introduce subtle whitespace-trimming/rendering issues with {{- ... }}. Indent this conditional (and its matching end) to the same level as other apiObjects children.
{{- 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.

Comment thread charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-info-missing This pr needs to mark a document option in description

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants