Skip to content

Commit 2817e38

Browse files
author
Vedant Madane
committed
address review: handle boolean cluster.mode, restore trailing newlines
1 parent 46b7cd8 commit 2817e38

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

contrib/charts/dragonfly/templates/_pod.tpl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@ containers:
8787
{{- toYaml . | trim | nindent 6 }}
8888
{{- end }}
8989
{{- with .Values.cluster }}
90-
{{- $clusterMode := printf "%v" (.mode | default "") }}
90+
{{- $modeRaw := .mode | default "" }}
91+
{{- $clusterMode := "" }}
92+
{{- if kindIs "bool" $modeRaw }}
93+
{{- if $modeRaw }}{{- $clusterMode = "yes" }}{{- end }}
94+
{{- else }}
95+
{{- $clusterMode = $modeRaw | toString }}
96+
{{- end }}
9197
{{- if ne $clusterMode "" }}
9298
- "--cluster_mode={{ $clusterMode }}"
9399
{{- end }}
@@ -154,4 +160,4 @@ volumes:
154160
{{- toYaml . | trim | nindent 2 }}
155161
{{- end }}
156162
{{- end }}
157-
{{- end }}
163+
{{- end }}

contrib/charts/dragonfly/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ extraArgs: []
175175

176176
cluster:
177177
# -- Redis cluster protocol mode passed to Dragonfly as --cluster_mode.
178-
# -- Use "emulated" or "yes" (must be quoted in YAML to avoid boolean coercion).
178+
# -- Accepts "emulated" or "yes". Unquoted `yes` (parsed as boolean by YAML)
179+
# -- is also supported and treated as the string "yes".
179180
# -- Leave empty to disable cluster mode.
180181
mode: ""
181182
# -- When cluster mode is enabled, pass --experimental_cluster_shard_by_slot=true
@@ -232,4 +233,4 @@ tolerations: []
232233
affinity: {}
233234

234235
# -- Topology Spread Constraints for pod assignment
235-
topologySpreadConstraints: []
236+
topologySpreadConstraints: []

0 commit comments

Comments
 (0)