Skip to content

helm: keep multi-entry drivers chart resources separate - #652

Open
sarankumar1325 wants to merge 1 commit into
ceph:mainfrom
sarankumar1325:helm-drivers-multi-doc-separator
Open

sarankumar1325 wants to merge 1 commit into
ceph:mainfrom
sarankumar1325:helm-drivers-multi-doc-separator

Conversation

@sarankumar1325

Copy link
Copy Markdown

Describe what this PR does

With two or more entries in cephConnections, clientProfiles or clientProfileReplications, the ceph-csi-drivers chart rendered all of them into one YAML document, so only the last entry was created.

The cause is the trailing -}} on the {{- if $x.name -}} line. It trims the newline before ---, which leaves the separator stuck to the last line of the previous entry (for example name: conn-a---). This PR changes it to }} in the three templates, so --- gets its own line again. Every other template in the chart already uses this form (storageclass.yaml, secret.yaml, ...).

Rendered with two entries of each kind (helm template t deploy/charts/ceph-csi-drivers -f values.yaml, then parsed with PyYAML):

  • before: 3 documents (profile-b, conn-b, rep-b)
  • after: 6 documents (profile-a, profile-b, conn-a, conn-b, rep-a, rep-b)

Default values still render the same, and helm lint passes.

Is there anything that requires special attention

It's a whitespace-only template change and backward compatible. Setups with a single entry render exactly as before (only a leading blank line changes).

Related issues

Fixes: #651

Future concerns

None.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow
    guidelines in the developer
    guide
    .
  • Reviewed the developer guide on Submitting a Pull
    Request
  • Pending release
    notes

    updated with breaking and/or notable changes for the next major release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

I made this change with help from an AI assistant. I reviewed it and checked the rendered output myself.

With more than one entry in cephConnections, clientProfiles or
clientProfileReplications, the trailing "-}}" on the "if .name" line
trimmed the newline before the "---" separator. The separator ended
up glued to the last line of the previous entry, so every entry was
rendered into one YAML document and only the last one was created.

Stop trimming after the if action so "---" starts its own line again.

Fixes: ceph#651

Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Helm: ceph-csi-drivers renders only the last entry of clientProfiles, cephConnections and `clientProfileReplications

1 participant