Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions install/helm/kgateway/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.podDisruptionBudget }}
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition checks if the podDisruptionBudget key exists, but it should check if it's non-empty. An empty object {} will evaluate to true, creating a PDB with no spec fields. Use {{- if and .Values.podDisruptionBudget (or .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable) }} instead.

Suggested change
{{- if .Values.podDisruptionBudget }}
{{- if and .Values.podDisruptionBudget (or .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable) }}

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@frauniki frauniki Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's incorrect.
In Helm's if expression, the empty object {} evaluates to false.

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "kgateway.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kgateway.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "kgateway.selectorLabels" . | nindent 6 }}
{{- with .Values.podDisruptionBudget }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
Loading
Loading