Skip to content

Regression for templates containing consecutive groups of 3 dashes after document separator fix #31935

Description

@marvin-roesch

What happened?

After upgrading a dependency (Flux Helm Controller) to use Helm 4.1.3, we started seeing Helm releases fail with a MalformedYAMLError: yaml: line 2: found unexpected end of stream error. These templates contain multiple consecutive groups of --- without using them as document separators (e.g. in script output etc.). Notably, these instances do not occur at the start of a line.

This is related to #31867 and #31868.

What did you expect to happen?

Templates with consecutive groups of --- that are not document separators should remain untouched.

How can we reproduce it (as minimally and precisely as possible)?

Reproduction works the same as in #31867, with the sole difference being the template being used. As a somewhat contrived example, one might use the following:

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: print-dashes-script
data:
  print-dashes.sh: |
    #!/usr/bin/env bash
    echo "------------------------------------"

Helm version

Details ```console $ helm version version.BuildInfo{Version:"v4.1.3", GitCommit:"c94d381b03be117e7e57908edbf642104e00eb8f", GitTreeState:"clean", GoVersion:"go1.25.8", KubeClientVersion:"v1.35"} ```

Kubernetes version

Details
$ kubectl version
Client Version: v1.34.3
Kustomize Version: v5.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions