{{- if and (not .Values.controller.admin.existingSecret) (.Values.controller.admin.createSecret) -}}

apiVersion: v1
kind: Secret
metadata:
  name: {{ template "jenkins.fullname" . }}
  namespace: {{ template "jenkins.namespace" . }}
  labels:
    {{ include "jenkins.labels" . | nindent 4 }}
type: Opaque
data:
  jenkins-admin-password: {{ template "jenkins.password" . }}
  jenkins-admin-user: {{ .Values.controller.admin.username | b64enc | quote }}
{{- end }}
