apiVersion: v1
kind: Secret
metadata:
  name: {{ template "harbor.core" . }}
  labels:
{{ include "harbor.labels" . | indent 4 }}
type: Opaque
data:
  secretKey: {{ .Values.secretKey | b64enc | quote }}
  secret: {{ .Values.core.secret | default (randAlphaNum 16) | b64enc | quote }}
{{- if not .Values.core.secretName }}
  tls.crt: {{ .Files.Get "cert/tls.crt" | b64enc }}
  tls.key: {{ .Files.Get "cert/tls.key" | b64enc }}
{{- end }}
  HARBOR_ADMIN_PASSWORD: {{ .Values.harborAdminPassword | b64enc | quote }}
  POSTGRESQL_PASSWORD: {{ template "harbor.database.encryptedPassword" . }}
{{- if .Values.clair.enabled }}
  CLAIR_DB_PASSWORD: {{ template "harbor.database.encryptedPassword" . }}
{{- end }}
