Skip to content

Whether templates are expanded in extraEnv is inconsistent #773

@andreasots

Description

@andreasots

Preflight checklist

Ory Network Project

No response

Describe the bug

When trying to provision databases for Hydra and Keto from my own chart I discovered that whether templates in extraEnv get expanded or not is inconsistent. In particular the main deployment template expands them but the automigration and janitor job templates do not. This is not the case with the Kratos chart where extraEnv gets expanded even in the automigration job template.

Reproducing the bug

  1. Expand the Hydra chart with the following values file:
hydra:
  automigration:
    enabled: true

janitor:
  enabled: true

deployment:
  extraEnv:
    - name: DSN
      valueFrom:
        secretKeyRef: "{{ .Release.Name }}-db-hydra"
        key: uri
  1. Notice that the expanded chart contains unexpanded templates:
$ helm template hydra ory/hydra -f values.yaml | grep -F '{{'
                    secretKeyRef: '{{ .Release.Name }}-db-hydra'
              secretKeyRef: '{{ .Release.Name }}-db-hydra'
  1. Expand the Keto chart with the following values file:
keto:
  automigration:
    enabled: true

deployment:
  extraEnv:
    - name: DSN
      valueFrom:
        secretKeyRef: "{{ .Release.Name }}-db-keto"
        key: uri
  1. Notice that the expanded chart contains unexpanded templates:
$ helm template keto ory/keto -f values.yaml | grep -F '{{'
              secretKeyRef: '{{ .Release.Name }}-db-keto'

Relevant log output

Relevant configuration

Version

chart version 0.53.0

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Kubernetes with Helm

Additional Context

extraEnv is not expanded in three places in the Hydra chart:

{{- with $janitorExtraEnv }}
{{- toYaml . | nindent 16 }}
{{- end }}

{{- with $migrationExtraEnv }}
{{- toYaml . | nindent 10 }}
{{- end }}

{{- with $migrationExtraEnv }}
{{- toYaml . | nindent 10 }}
{{- end }}

And in a single place in the Keto chart:

{{- with $migrationExtraEnv }}
{{- toYaml . | nindent 10 }}
{{- end }}

Also in the example-idp and kratos-selfservice-ui-node charts extraEnv is not expanded at all:

{{- with .Values.deployment.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}

{{- if .Values.deployment.extraEnv }}
{{- toYaml .Values.deployment.extraEnv | nindent 10 }}
{{- end }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions