Skip to content

.Release.Labels are not available within values templates #435

Description

@sisrael-dn

Operating system

macOS Monterey Version 12.5

Helmfile Version

0.147.0

Helm Version

3.10.1

Bug description

Since 0.147.0 it seems like .Release.Labels are no longer available to use within values templates.
Same example works fine with previous releases.

Example helmfile.yaml

helmfile.yaml:

repositories:
  - name: jenkinsci
    url: https://charts.jenkins.io
 
templates:
  jenkins: &jenkins
    name: jenkins{{`{{.Release.Labels.jenkinsInstance}}`}}
    chart: jenkinsci/jenkins
    version: 4.1.16
    labels:
      group: jenkins
      privateRegistry: 123456789.dkr.ecr.us-west-1.amazonaws.com
    namespace: jenkins{{`{{.Release.Labels.jenkinsInstance}}`}}
    values:
      - jenkins.yaml.gotmpl

releases:
  - labels:
      jenkinsInstance: "1"
      zone: us-west-1b
      branch: master
      jobsTags: ""
    <<: *jenkins

jenkins.yaml.gotmpl:

agent:
  image: '{{ .Release.Labels.privateRegistry }}/jenkins-agent'

Error message you've seen (if any)

in ./helmfile.yaml: failed to render values files "jenkins.yaml.gotmpl": failed to render [jenkins.yaml.gotmpl], because of template: stringTemplate:2:21: executing "stringTemplate" at <.Release.Labels.privateRegistry>: map has no entry for key "privateRegistry"

Steps to reproduce

helmfile -f ./helmfile.yaml -l name=jenkins1 template

Working Helmfile Version

0.146.0

Relevant discussion

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions