After upgrading to Helm Controller 1.5.3 (via Flux 2.8.3) which ships helm/helm#31941, we've started seeing pods crash looping without any modifications to their originating chart. After some investigation, we found that rendered ConfigMaps (and other resources as well, very likely) had multi-line strings preserving final newlines (i.e. key: |\n...) modified to strip the final newline (i.e. key: |-\n...). The container running in the affected pods (haproxy) required its config to end in a newline, causing the crash.
This appears to happen when the end of the string value coincides with the end of the file. Here's an example:
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
data:
value-a: |
line1
line2
dummy-string: |
line1
line2
This gets rendered/applied by the Helm controller as follows:
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
data:
value-a: |
line1
line2
dummy-string: |-
line1
line2
The fix it seems would be to preserve final newlines when splitting documents on separators.
After upgrading to Helm Controller 1.5.3 (via Flux 2.8.3) which ships helm/helm#31941, we've started seeing pods crash looping without any modifications to their originating chart. After some investigation, we found that rendered
ConfigMaps(and other resources as well, very likely) had multi-line strings preserving final newlines (i.e.key: |\n...) modified to strip the final newline (i.e.key: |-\n...). The container running in the affected pods (haproxy) required its config to end in a newline, causing the crash.This appears to happen when the end of the string value coincides with the end of the file. Here's an example:
This gets rendered/applied by the Helm controller as follows:
The fix it seems would be to preserve final newlines when splitting documents on separators.