{{- define "client.config" }}
  address: {{ .Values.address | quote }}
  oauth2:
    client_id: {{ .Values.oauth2ClientID | quote }}
    client_secret: {{ .Values.oauth2ClientSecret | quote }}
    token_url: {{ .Values.oauth2TokenURL | quote }}
{{- end }}
apiVersion: v1
kind: Secret
metadata:
  name: client-config
  labels:
    app.kubernetes.io/name: redskyops
    helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
    app.kubernetes.io/instance: {{ .Release.Name | quote }}
    app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
type: Opaque
data:
  client.yaml: {{ include "client.config" . | b64enc }}
