Skip to content

The values.yaml file's k8s secret references are not respected in the secret template #236

@nbenmoody-tesouro

Description

@nbenmoody-tesouro

Scenario

When I follow this values reference for the helm chart (v6.4.11), there are several values that are simple disregarded by the actual template:

licenseKeySecretName / licenseKeySecretKey

values.yaml has:

config:
  licenseKey: "EXPIRED-LICENSE-KEY-TRIAL"
  # licenseKeySecretName is the name of the secret where the Retool license key is stored (can be used instead of licenseKey)
  # licenseKeySecretName:
  # licenseKeySecretKey is the key in the k8s secret, default: license-key
  # licenseKeySecretKey:

...but the secret template just has this, which results in the default value being used instead:

data:
  license-key: {{ .Values.config.licenseKey | default "" | b64enc | quote }}

clientSecretSecretName / clientSecretSecretKey

values.yaml has:

  auth:
    google:
      clientId:
      clientSecret:
      # clientSecretSecretName is the name of the secret where the google client secret is stored (can be used instead of clientSecret)
      # clientSecretSecretName:
      # clientSecretSecretKey is the key in the k8s secret, default: google-client-secret
      # clientSecretSecretKey:

...but the secret template just has this, which results in the default value being used, also:

  {{ if .Values.config.auth.google.clientSecret }}
  google-client-secret: {{ .Values.config.auth.google.clientSecret | b64enc | quote }}
  {{ else  }}
  google-client-secret: ""
  {{ end }}

Postgres config's passwordSecretName / passwordSecretKey

values.yaml has:

    # passwordSecretName is the name of the secret where the pg password is stored (can be used instead of password)
    # passwordSecretName:
    # passwordSecretKey is the key in the k8s secret, default: postgresql-password
    # passwordSecretKey:

...but the secret template just has this, with the same issue:

  {{ if not .Values.postgresql.enabled }}
  postgresql-password: {{ .Values.config.postgresql.password | default "" | b64enc | quote }}
  {{ end }}

This is pretty easy to spot, if you look at the templates on artifact.hub.

Suggestion:

Looks like this template just needs to be updated, to follow the pattern that is already in there for other K8s Secret references. Like this one, for encryption-key:

  {{ if not .Values.config.encryptionKeySecretName }}
  {{ if .Values.config.encryptionKey }}
  encryption-key: {{ .Values.config.encryptionKey | b64enc | quote }}
  {{ else if (get $secretData "encryption-key") }}
  encryption-key: {{ get $secretData "encryption-key" }}
  {{ else }}
  encryption-key: {{ required "Please set a value for .Values.config.encryptionKey" .Values.config.encryptionKey }}
  {{ end }}
  {{ end }}

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