Skip to content
Open
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
2 changes: 1 addition & 1 deletion helm/robusta/templates/forwarder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ spec:
cpu: {{ .Values.kubewatch.resources.requests.cpu }}
memory: {{ if .Values.isSmallCluster }}"64Mi"{{ else }}{{ .Values.kubewatch.resources.requests.memory | quote }}{{ end }}
limits:
cpu: {{ .Values.kubewatch.resources.limits.cpu }}
memory: {{ if .Values.isSmallCluster }}"64Mi"{{ else if .Values.kubewatch.resources.limits.memory }}{{ .Values.kubewatch.resources.limits.memory | quote }}{{ else }}{{ .Values.kubewatch.resources.requests.memory | quote }}{{ end }}
Comment on lines +74 to 75
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Restore conditional rendering for cpu limit

Emitting cpu: {{ .Values.kubewatch.resources.limits.cpu }} unconditionally breaks the common use case where operators set that value to null to remove the limit—Helm renders it as <no value>, yielding invalid YAML and failing the deploy. Please wrap the stanza with an if/with, as it was before, so the key is omitted when the value is unset.

Apply this diff to bring back the guard:

-          limits:
-            cpu: {{ .Values.kubewatch.resources.limits.cpu }}
+          limits:
+          {{- with .Values.kubewatch.resources.limits.cpu }}
+            cpu: {{ . }}
+          {{- end }}
             memory: {{ if .Values.isSmallCluster }}"64Mi"{{ else if .Values.kubewatch.resources.limits.memory }}{{ .Values.kubewatch.resources.limits.memory | quote }}{{ else }}{{ .Values.kubewatch.resources.requests.memory | quote }}{{ end }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cpu: {{ .Values.kubewatch.resources.limits.cpu }}
memory: {{ if .Values.isSmallCluster }}"64Mi"{{ else if .Values.kubewatch.resources.limits.memory }}{{ .Values.kubewatch.resources.limits.memory | quote }}{{ else }}{{ .Values.kubewatch.resources.requests.memory | quote }}{{ end }}
limits:
{{- with .Values.kubewatch.resources.limits.cpu }}
cpu: {{ . }}
{{- end }}
memory: {{ if .Values.isSmallCluster }}"64Mi"{{ else if .Values.kubewatch.resources.limits.memory }}{{ .Values.kubewatch.resources.limits.memory | quote }}{{ else }}{{ .Values.kubewatch.resources.requests.memory | quote }}{{ end }}
🤖 Prompt for AI Agents
In helm/robusta/templates/forwarder.yaml around lines 74-75, the cpu limit key
is emitted unconditionally causing Helm to render "<no value>" when
.Values.kubewatch.resources.limits.cpu is null; wrap the cpu line in an if (or
with) guard that only renders the entire "cpu: ..." line when
.Values.kubewatch.resources.limits.cpu is set (preserve current indentation),
leaving the key out otherwise so the generated YAML remains valid.

{{ if .Values.kubewatch.resources.limits.cpu }}cpu: {{ .Values.kubewatch.resources.limits.cpu | quote }}{{ end }}
volumes:
- name: {{ include "robusta.fullname" . }}-kubewatch-config
configMap:
Expand Down
2 changes: 1 addition & 1 deletion helm/robusta/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ kubewatch:
cpu: 10m
memory: 512Mi
limits:
cpu: ~
cpu: 50m
additional_env_vars: []
priorityClassName: ""
tolerations: []
Expand Down