Commit b4fbf4e
authored
fix(helm): indent of extra volumes (#614)
Issue [#2583](aws-controllers-k8s/community#2583)
Description of changes:
This PR addresses an issue encountered when rendering a Helm chart that includes additional volumes, such as an emptyDir. The change ensures with `-` that leading whitespace is trimmed and using `nindent` instead of `indent` prevents unwanted blank lines. The issue originates from the following pull request #608.
To manually validate the fix of this PR in a chart based on the code-generator follow the steps below:
```
# Pull and extract the ACM chart, which is based on the code-generator:
$ helm pull oci://public.ecr.aws/aws-controllers-k8s/acm-chart --version 1.0.14 && tar -xzf acm-chart-1.0.14.tgz
# Apply the fix from this PR to the chart
$ sed -i '208s|.*| {{- toYaml .Values.deployment.extraVolumes \| nindent 8 }}|' ./acm-chart/templates/deployment.yaml
# Render the chart and verify the output:
$ helm template ./acm-chart --set deployment.extraVolumes[0].name=test --set deployment.extraVolumes[0].emptyDir.sizeLimit=1Mi
# Expected output snippet:
...
hostPID: false
hostNetwork: false
dnsPolicy: ClusterFirst
volumes:
- emptyDir:
sizeLimit: 1Mi
name: test
```
To reproduce the issue with the current version, refer to the steps outlined in the mentioned issue at top.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.1 parent fc0b91c commit b4fbf4e
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
0 commit comments