{{- if and .Values.externalSecrets.enabled .Values.externalSecrets.manageEDPInstallSecrets }}
{{- $secretStore := include "edp-install.secretStoreName" . }}
{{- $awsSecretName := .Values.externalSecrets.manageEDPInstallSecretsName }}
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: ci-dependency-track
spec:
  target:
    template:
      metadata:
        labels:
          app.edp.epam.com/secret-type: dependency-track
          app.edp.epam.com/integration-secret: "true"
  refreshInterval: 1h
  secretStoreRef:
    kind: SecretStore
    name: {{ $secretStore }}
  data:
  - secretKey: token
    remoteRef:
      key: {{ $awsSecretName }}
      property: ci-dependency-track.token
  - secretKey: url
    remoteRef:
      key: {{ $awsSecretName }}
      property: ci-dependency-track.url
{{- end }}
