{{/*
Copyright 2024 Vexxhost Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if .Values.manifests.secret_db_persistence }}
{{- $envAll := . }}
{{- range $key1, $userClass := tuple "admin" "octavia" }}
{{- $secretName := index $envAll.Values.secrets.oslo_db_persistence $userClass }}
---
apiVersion: v1
kind: Secret
metadata:
  name: {{ $secretName }}
type: Opaque
data:
  DB_CONNECTION: {{ tuple "oslo_db_persistence" "internal" $userClass "mysql" $envAll | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | b64enc -}}
{{- end }}
{{- end }}
