{{- $secret := (lookup "v1" "Secret" .Release.Namespace .Values.geoServer.secret.name) }}
---
apiVersion: v1
kind: Secret
metadata:
  name: {{ .Values.geoServer.secret.name }}
  annotations:
    "helm.sh/resource-policy": keep
type: Opaque
  {{- if $secret }}
data:
  password: {{ $secret.data.password }}
  {{- else }}
stringData:
  {{- $password := randAlphaNum 20 | quote }}
  password: {{ $password }}
{{- end -}}
