Skip to content

Helm chart 1.4.0 fails templating when rbac.rules or rbac.clusterRules is empty array #4778

@Ryan-Brice

Description

@Ryan-Brice

Component(s)

No response

What's wrong?

In the latest version of the Alloy Helm chart (1.4.0), when either rbac.rules or rbac.clusterRules is set as an empty array with [], Helm template fails with the following error:

Error: YAML parse error on alloy/templates/rbac.yaml: error converting YAML to JSON: yaml: line 14: did not find expected key

Use --debug flag to render out invalid YAML

Steps to reproduce

Run the following command(s) when using Helm chart version 1.4.0:

  1. If repo is not already installed for helm locally:

    helm repo add grafana https://grafana.github.io/helm-charts
  2. Create values.yaml file with one or both of rbac.rules and rbac.clusterRules set as [].

  3. Build the chart

    # Get chart tar file
    helm pull grafana/alloy --version 1.4.0
    # Build chart to 'output-file.yaml'
    helm template alloy "alloy-1.4.0.tgz" \
          --namespace "monitoring" \
          --values=values.yaml \
          >output-file.yaml

System information

Arch Linux 6.17.5-1-cachyos

Software version

Grafana Alloy Helm Chart 1.4.0

Helm version v3.19.0

Configuration

# values.yaml
rbac:
  create: true
  rules: []
  clusterRules: []

Logs

install.go:225: 2025-11-05 20:54:43.97915119 +0800 AWST m=+0.016979119 [debug] Original chart version: ""
install.go:242: 2025-11-05 20:54:43.97917433 +0800 AWST m=+0.017002249 [debug] CHART PATH: /tmp/tmp.ImrXxbbqCo/alloy-1.4.0.tgz

Error: YAML parse error on alloy/templates/rbac.yaml: error converting YAML to JSON: yaml: line 14: did not find expected key
helm.go:92: 2025-11-05 20:54:43.9825483 +0800 AWST m=+0.020376229 [debug] error converting YAML to JSON: yaml: line 14: did not find expected key
YAML parse error on alloy/templates/rbac.yaml
helm.sh/helm/v3/pkg/releaseutil.(*manifestFile).sort
	/build/helm/src/helm/pkg/releaseutil/manifest_sorter.go:152
helm.sh/helm/v3/pkg/releaseutil.SortManifests
	/build/helm/src/helm/pkg/releaseutil/manifest_sorter.go:104
helm.sh/helm/v3/pkg/action.(*Configuration).renderResources
	/build/helm/src/helm/pkg/action/action.go:172
helm.sh/helm/v3/pkg/action.(*Install).RunWithContext
	/build/helm/src/helm/pkg/action/install.go:317
main.runInstall
	/build/helm/src/helm/cmd/helm/install.go:317
main.newTemplateCmd.func2
	/build/helm/src/helm/cmd/helm/template.go:95
github.com/spf13/cobra.(*Command).execute
	/build/helm/src/helm/vendor/github.com/spf13/cobra/command.go:1015
github.com/spf13/cobra.(*Command).ExecuteC
	/build/helm/src/helm/vendor/github.com/spf13/cobra/command.go:1148
github.com/spf13/cobra.(*Command).Execute
	/build/helm/src/helm/vendor/github.com/spf13/cobra/command.go:1071
main.main
	/build/helm/src/helm/cmd/helm/helm.go:91
runtime.main
	/usr/lib/go/src/runtime/proc.go:285
runtime.goexit
	/usr/lib/go/src/runtime/asm_amd64.s:1693

Tip

React with 👍 if this issue is important to you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions