{{- if and .Values.webhook.enabled .Values.webhook.pdb.enabled (not .Values.controller.rbac.namespaced) }} apiVersion: {{ template "argo-events.pdb.apiVersion" . }} kind: PodDisruptionBudget metadata: name: {{ template "argo-events.webhook.fullname" . }} labels: {{- include "argo-events.labels" (dict "context" . "component" .Values.webhook.name "name" .Values.webhook.name) | nindent 4 }} {{- with .Values.webhook.pdb.labels }} {{- toYaml . | nindent 4 }} {{- end }} {{- with .Values.webhook.pdb.annotations }} annotations: {{- range $key, $value := . }} {{ $key }}: {{ $value | quote }} {{- end }} {{- end }} spec: {{- if .Values.webhook.pdb.minAvailable }} minAvailable: {{ .Values.webhook.pdb.minAvailable }} {{- else if .Values.webhook.pdb.maxUnavailable }} maxUnavailable: {{ .Values.webhook.pdb.maxUnavailable }} {{- else }} minAvailable: 0 {{- end }} selector: matchLabels: {{- include "argo-events.selectorLabels" (dict "context" . "name" .Values.webhook.name) | nindent 6 }} {{- end }}