{{ if and .Values.images.registry.ImagePullSecret.name .Values.images.registry.ImagePullSecret.create -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ .Values.images.registry.ImagePullSecret.name }}
  labels:
    {{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels  | indent 4 }}
    {{- end }}
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: {{ template "imagePullSecret" . }}
{{- end }}