{{/*
This manifest results a secret being created which has the keyring information
needed for cinder rbd user of external managed ceph backend
*/}}

{{- if and .Values.ceph_client.enable_external_ceph_backend .Values.ceph_client.external_ceph.rbd_user }}

{{- $envAll := . }}
{{- $userClass := "volume_external" }}
{{- $secretName := index $envAll.Values.secrets.rbd $userClass }}
---
apiVersion: v1
kind: Secret
metadata:
  name: {{ $secretName }}
  annotations:
{{ tuple "rbd" $userClass $envAll | include "helm-toolkit.snippets.custom_secret_annotations" | indent 4 }}
type: Opaque
data:
  key: {{ $envAll.Values.ceph_client.external_ceph.rbd_user_keyring | b64enc }}
...
{{- end }}
