{{- if and .Values.openai.enabled (not .Values.openai.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "nextcloud-mcp-server.fullname" . }}-openai
  labels:
    {{- include "nextcloud-mcp-server.labels" . | nindent 4 }}
type: Opaque
data:
  {{ .Values.openai.secretKey }}: {{ .Values.openai.apiKey | b64enc | quote }}
{{- end }}
