Skip to content

extraEnvVars valueFrom #43

@Spritekin

Description

@Spritekin

Right now the deployments.yaml file process the extraEnvVars like this:

            {{- range .Values.extraEnvVars }}
            - name: {{ .name }}
              value: {{ .value | quote }}
            {{- end }}

So it only contemplates a hardcoded value.
I would like to load the values from a secret like this:

    extraEnvVars:
      - name: OAUTH_CLIENT_ID
        valueFrom:
          secretKeyRef:
            name: vouch-okta
            key: OAUTH_CLIENT_ID
      - name: OAUTH_CLIENT_SECRET
        valueFrom:
          secretKeyRef:
            name: vouch-okta
            key: OAUTH_CLIENT_SECRET

However if I do this the deployment ends like this

        - name: OAUTH_CLIENT_ID
        - name: OAUTH_CLIENT_SECRET

With no values, because there is no .value in the structure.

So maybe in the deployment.yaml code the env vars should be handled as (indent 12 referencial only I haven't really counted):

            {{- if .Values.extraEnvVars }}
            {{- toYaml .Values.extraEnvVars | indent 12 }}
            {{- end }}

handling it that way allows the user setting the env vars in any way they need.

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