{{- $mmOpOldValues := default dict .Values.addons.mattermostoperator -}}
{{- $mmOpValues := merge $mmOpOldValues .Values.addons.mattermostOperator -}}
{{- if or $mmOpValues.enabled .Values.addons.mattermost.enabled }}
{{- if ( include "imagePullSecret" . ) }}
apiVersion: v1
kind: Secret
metadata:
  name: private-registry
  namespace: mattermost-operator
  labels:
    app.kubernetes.io/name: mattermost-operator
    app.kubernetes.io/component: "collaboration-tools"
    {{- include "commonLabels" . | nindent 4}}
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: {{ template "imagePullSecret" . }}
{{- end }}
{{- end }}