{{- if .Capabilities.APIVersions.Has "keda.sh/v1alpha1" -}}
{{- range $authName, $config := .Values.global.keda.authentications }}
---
apiVersion: v1
kind: Secret
metadata:
  annotations:
    app.kubernetes.io/version: {{ $.Values.global.deployment_id | quote }}
    dokku.com/managed: "true"
    {{ include "print.annotations" (dict "config" $.Values.global "key" "keda_secret") | indent 4 }}
  labels:
    app.kubernetes.io/instance: {{ $.Values.global.app_name }}-{{ $config.type }}
    app.kubernetes.io/name: {{ $config.type }}
    app.kubernetes.io/part-of: {{ $.Values.global.app_name }}
    {{ include "print.labels" (dict "config" $.Values.global "key" "keda_secret") | indent 4 }}
  name: kta-{{ $.Values.global.app_name }}-{{ $config.type }}
  namespace: {{ $.Values.global.namespace }}
data:
{{- with $config.secrets }}
data:
  {{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}
