{{- if .Values.chartmuseum.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: "{{ template "harbor.chartmuseum" . }}"
  labels:
{{ include "harbor.labels" . | indent 4 }}
type: Opaque
data:
  CACHE_REDIS_PASSWORD: {{ include "harbor.redis.rawPassword" . | b64enc | quote }}
{{- $storage := .Values.persistence.imageChartStorage }}
{{- $storageType := $storage.type }}
{{- if eq $storageType "azure" }}
  AZURE_STORAGE_ACCESS_KEY: {{ $storage.azure.accountkey | b64enc | quote }}
{{- else if eq $storageType "gcs" }}
  # TODO support the keyfile of gcs
{{- else if eq $storageType "s3" }}
  {{- if $storage.s3.secretkey }}
  AWS_SECRET_ACCESS_KEY: {{ $storage.s3.secretkey | b64enc | quote }}
  {{- end }}
{{- else if eq $storageType "swift" }}
  OS_PASSWORD: {{ $storage.swift.password | b64enc | quote }}
{{- else if eq $storageType "oss" }}
  ALIBABA_CLOUD_ACCESS_KEY_SECRET: {{ $storage.oss.accesskeysecret | b64enc | quote }}
{{- end }}
{{- end }}