Skip to content

Loki helm problem when templating backend statefulset with extraEnv #17284

@joe-pll

Description

@joe-pll

Describe the bug
When defining global.extraEnv the helm templating add the extraEnv in the envFrom in the statefulset for the backend.

This is the bit of the template for the templates/backend/statefulset-backend.yaml

{{- with (concat .Values.global.extraEnv .Values.backend.extraEnv) | uniq }}
env:
  {{- toYaml . | nindent 12 }}
{{- end }}
{{- with (concat .Values.global.extraEnv .Values.backend.extraEnvFrom) | uniq }}
envFrom:
  {{- toYaml . | nindent 12 }}
{{- end }}

The with statement is

{{- with (concat .Values.global.extraEnv .Values.backend.extraEnvFrom) | uniq }}

while it should be

{{- with (concat .Values.global.extraEnvFrom .Values.backend.extraEnvFrom) | uniq }}

To Reproduce
Define global.extraEnv in the helm chart values.

Expected behavior
Kubernetes fails to apply because the field envFrom has the wrong format.

Environment:
Kubernetes 1.32

Thanks a lot in advance and let me know if you want me to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/helmtype/bugSomehing is not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions