Skip to content
Open
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
1 change: 1 addition & 0 deletions helm/templates/ray-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ spec:
labels:
model: {{ $modelSpec.name }}
helm-release-name: {{ .Release.Name }}
{{- include "chart.engineLabels" . | nindent 12 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While this change correctly uses the existing chart.engineLabels helper, this helper has a potential flaw. If .Values.servingEngineSpec.labels is defined as an empty map (e.g., labels: {} in values.yaml), the toYaml function within the helper will render {}. This results in invalid YAML for the pod labels, causing Helm to fail during template rendering.

To make the chart more robust, I recommend improving the chart.engineLabels helper in helm/templates/_helpers.tpl. A safer implementation would be to iterate through the labels, which correctly handles an empty map.

Here is a suggested implementation for the helper:

{{- define "chart.engineLabels" -}}
{{- range $key, $value := .Values.servingEngineSpec.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}

Since this is a pre-existing issue and you are following an established pattern, this is not a blocker for this PR. However, addressing this would be a valuable improvement for the chart's stability.

{{- if .Values.servingEngineSpec.securityContext }}
securityContext:
{{- toYaml .Values.servingEngineSpec.securityContext | nindent 10 }}
Expand Down