{{/*
AUTOGENERATED FILE - DO NOT EDIT.
Generated by scripts/generate_env_tpls.py from charts/agentarea/config.yaml
*/}}

{{- define "agentarea.storage.configVars" -}}
AWS_REGION: "{{ .Values.global.storage.region }}"
S3_BUCKET_NAME: "{{ .Values.global.storage.bucket }}"
ARTIFACTS_BUCKET_NAME: "{{ .Values.global.storage.bucket }}"
AWS_ENDPOINT_URL: "http://{{ include "agentarea.rustfs.host" . }}:9000"
{{- end }}

{{- define "agentarea.storage.envs" }}
- name: AWS_REGION
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-storage
      key: AWS_REGION
- name: S3_BUCKET_NAME
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-storage
      key: S3_BUCKET_NAME
- name: ARTIFACTS_BUCKET_NAME
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-storage
      key: ARTIFACTS_BUCKET_NAME
- name: AWS_ENDPOINT_URL
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-storage
      key: AWS_ENDPOINT_URL
{{- end }}

{{- define "agentarea.storage.secrets.envs" }}
{{ if .Values.rustfs.enabled }}
- name: AWS_ACCESS_KEY_ID
  valueFrom:
    secretKeyRef:
      name: "{{ .Values.global.secrets.rustfs }}"
      key: root-user
- name: AWS_SECRET_ACCESS_KEY
  valueFrom:
    secretKeyRef:
      name: "{{ .Values.global.secrets.rustfs }}"
      key: root-password
{{- end }}
{{- end }}
