Skip to content

Commit

Permalink
helm: Avoid error in IDE due to .range keyword
Browse files Browse the repository at this point in the history
As range is a keyword in jinja template, using the expression with usual
attribute name (e.g. .Values.nodePort.range) will cause the error in IDE.
This issue makes it hard for deployment helm for normal operation like
checking where the flag is used.

This commit is to use alternative way to get around the issue with get
function.

Testing was done as per below

```
$ cat temp_values.yaml
nodePort:
  range: "30000,32767"
$ helm template cilium install/kubernetes/cilium -f temp_values.yaml | grep node-port-range
  node-port-range: "30000,32767"
  enable-auto-protect-node-port-range: "true"
```

Signed-off-by: Tam Mach <tam.mach@cilium.io>
  • Loading branch information
sayboras authored and michi-covalent committed May 31, 2023
1 parent 57f6f04 commit 1c0e769
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion install/kubernetes/cilium/templates/cilium-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ data:
enable-node-port: {{ .Values.nodePort.enabled | quote }}
{{- end }}
{{- if hasKey .Values.nodePort "range" }}
node-port-range: {{ .Values.nodePort.range | quote }}
node-port-range: {{ get .Values.nodePort "range" | quote }}
{{- end }}
{{- if hasKey .Values.nodePort "directRoutingDevice" }}
direct-routing-device: {{ .Values.nodePort.directRoutingDevice | quote }}
Expand Down

0 comments on commit 1c0e769

Please sign in to comment.