Skip to content

New YAML manifest splitting from Helm fork changes multi-line string modifiers #1448

@marvin-roesch

Description

@marvin-roesch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked/upstreamBlocked by an upstream dependency or issuebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions