{{- if (and .Values.ecr.enabled .Values.ecr.secretAccessKey) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "keel.name" . }}-aws-ecr
  namespace: {{ .Release.Namespace }}
  labels:
    app: {{ template "keel.name" . }}
    chart: {{ template "keel.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
type: Opaque
data:
  secretAccessKey:  {{ .Values.ecr.secretAccessKey | b64enc }}
{{- end }}
