{{- if and (include "mongodb.hidden.enabled" .) .Values.hidden.pdb.create }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
  name: {{ include "mongodb.fullname" . }}-hidden
  namespace: {{ include "mongodb.namespace" . }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    app.kubernetes.io/component: hidden
    {{- if .Values.commonLabels }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    {{- end }}
spec:
  {{- if .Values.hidden.pdb.minAvailable }}
  minAvailable: {{ .Values.hidden.pdb.minAvailable }}
  {{- end }}
  {{- if .Values.hidden.pdb.maxUnavailable }}
  maxUnavailable: {{ .Values.hidden.pdb.maxUnavailable }}
  {{- end }}
  selector:
    matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
      app.kubernetes.io/component: hidden
{{- end }}
