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

{{- if and .Values.concierge.enabled .Values.concierge.deployAPIService }}
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
  name: v1alpha1.identity.concierge.pinniped.dev
  namespace: {{ include "common.names.namespace" . | quote }}
  labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
    app.kubernetes.io/part-of: pinniped
    app.kubernetes.io/component: concierge
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
spec:
  version: v1alpha1
  group: identity.concierge.pinniped.dev
  groupPriorityMinimum: 9900
  versionPriority: 15
  service:
    name: {{ template "pinniped.concierge.api.fullname" . }}
    namespace: {{ template "common.names.namespace" . }}
    port: 443
{{- end }}
