{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

apiVersion: v1
kind: Secret
metadata:
  name: {{ include "chainloop.cas.fullname" . }}
  namespace: {{ include "common.names.namespace" . | quote }}
  labels: {{ include "chainloop.cas.labels" . | nindent 4 }}
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
type: Opaque
stringData:
  {{- if and .Values.cas.sentry .Values.cas.sentry.enabled }}
  config.observability.yaml: |
    {{- include "chainloop.sentry" .Values.cas.sentry | nindent 4 }}
  {{- end }}
  config.secret.yaml: |
    credentials_service: {{- include "chainloop.credentials_service_settings" . | indent 6 }}
    auth:
      public_key_path: "/tmp/cas.public.pem"
      # Deprecated, use public_key_path instead. Remove option once release of the app 0.15+ is out.
      robot_account_public_key_path: "/tmp/cas.public.pem"
    # TODO: add observability
