{{- if .Values.admissionWebhooks.enabled -}}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "oam-runtime.name" . }}-webhook
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "oam-runtime.labels" . | nindent 4 }}
spec:
  type: {{ .Values.webhookService.type }}
  ports:
    - port: 443
      targetPort: {{ .Values.webhookService.port }}
      protocol: TCP
      name: https
  selector:
    {{ include "oam-runtime.selectorLabels" . | nindent 6 }}

{{- end -}}
