{{- if .Capabilities.APIVersions.Has "keda.sh/v1alpha1" -}}
---
apiVersion: keda.sh/v1alpha1
kind: ClusterTriggerAuthentication
metadata:
  annotations:
    dokku.com/managed: "true"
    {{ include "print.annotations" (dict "config" $.Values.global "key" "keda_trigger_authentication") | indent 4 }}
  labels:
    app.kubernetes.io/instance: {{ $.Values.type }}
    app.kubernetes.io/name: {{ $.Values.type }}
    app.kubernetes.io/part-of: cluster
    {{ include "print.labels" (dict "config" $.Values.global "key" "keda_trigger_authentication") | indent 4 }}
  name: {{ $.Values.type }}
spec:
  secretTargetRef:
  {{- range $k, $v := $.Values.secrets }}
  - key: {{ $k }}
    name: ckta-{{ $.Values.type }}
    parameter: {{ $k }}
  {{- end }}
{{- end }}
