apiVersion: v1
kind: ConfigMap
metadata:
  name: netbox-webhook-dist-nats-config
data:
  nats.conf: |
    # PID file shared with configuration reloader.
    # pid_file: "/var/run/nats/nats.pid"
    http: 8222
    server_name: {{- if .Values.nats.serverNamePrefix  }}$SERVER_NAME{{- else }}$POD_NAME{{- end }}
    jetstream {
      {{- if .Values.nats.jetstream.memStorage.enabled }}
      max_memory_store: {{ .Values.nats.jetstream.memStorage.size }}
      {{- end }}
      {{- if .Values.nats.jetstream.fileStorage.enabled }}
      store_dir: {{ .Values.nats.jetstream.fileStorage.storageDirectory }}
      max_file:
      {{- if .Values.nats.jetstream.fileStorage.existingClaim }}
      {{- .Values.nats.jetstream.fileStorage.claimStorageSize  }}
      {{- else }}
      {{- .Values.nats.jetstream.fileStorage.size }}
      {{- end }}
      {{- end }}
    }