{{- if not .Values.security.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "attune.secretName" . }}
  labels:
    {{- include "attune.labels" . | nindent 4 }}
type: Opaque
stringData:
  ATTUNE__SECURITY__JWT_SECRET: {{ .Values.security.jwtSecret | quote }}
  ATTUNE__SECURITY__ENCRYPTION_KEY: {{ .Values.security.encryptionKey | quote }}
  ATTUNE__DATABASE__URL: {{ include "attune.databaseUrl" . | quote }}
  ATTUNE__MESSAGE_QUEUE__URL: {{ include "attune.rabbitmqUrl" . | quote }}
  ATTUNE__CACHE__URL: {{ include "attune.redisUrl" . | quote }}
  DB_HOST: {{ include "attune.postgresqlServiceName" . | quote }}
  DB_PORT: {{ .Values.database.port | quote }}
  DB_USER: {{ .Values.database.username | quote }}
  DB_PASSWORD: {{ .Values.database.password | quote }}
  DB_NAME: {{ .Values.database.database | quote }}
  DB_SCHEMA: {{ .Values.database.schema | quote }}
  TEST_LOGIN: {{ .Values.bootstrap.testUser.login | quote }}
  TEST_DISPLAY_NAME: {{ .Values.bootstrap.testUser.displayName | quote }}
  TEST_PASSWORD: {{ .Values.bootstrap.testUser.password | quote }}
  DEFAULT_ADMIN_LOGIN: {{ .Values.bootstrap.testUser.login | quote }}
  DEFAULT_ADMIN_PERMISSION_SET_REF: "core.admin"
  SOURCE_PACKS_DIR: "/source/packs"
  TARGET_PACKS_DIR: "/opt/attune/packs"
  RUNTIME_ENVS_DIR: "/opt/attune/runtime_envs"
  ARTIFACTS_DIR: "/opt/attune/artifacts"
  LOADER_SCRIPT: "/scripts/load_core_pack.py"
{{- end }}
