{{- if and .Values.podDisruptionBudget.enabled (eq .Values.mode "deployment") }}
apiVersion: {{ include "podDisruptionBudget.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
  name: {{ include "opentelemetry-collector.fullname" . }}
  labels:
    {{- include "opentelemetry-collector.labels" . | nindent 4 }}
spec:
  {{- if .Values.podDisruptionBudget.minAvailable }}
  minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
  {{- end  }}
  {{- if .Values.podDisruptionBudget.maxUnavailable }}
  maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
  {{- end  }}
  selector:
    matchLabels:
      {{- include "opentelemetry-collector.selectorLabels" . | nindent 6 }}
{{- end }}
