influxdata / influxdata/helm-charts
Error setting port values after version upgrade
- Dominant language
- Mustache
- Stars
- 257
- Forks
- 347
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
After upgrading our Helm chart from `4.12.1` to `4.12.2` we get an error with the setting of the udp port. After the upgrade, this is set via the helpers function, but this leads to the following error:
our actual config
```
config:
udp:
enabled: true
```
error
```
install.go:200: [debug] Original chart version: ""
install.go:217: [debug] CHART PATH: /Users/nevado/git/brainbits/github/influxdb/helm-charts/charts/influxdb
Error: template: influxdb/templates/statefulset.yaml:77:28: executing "influxdb/templates/statefulset.yaml" at : error calling include: template: influxdb/templates/_helpers.tpl:87:64: executing "influxdb.udpPortNumber" at <"bind-address">: invalid value; expected string
helm.go:84: [debug] template: influxdb/templates/statefulset.yaml:77:28: executing "influxdb/templates/statefulset.yaml" at : error calling include: template: influxdb/templates/_helpers.tpl:87:64: executing "influxdb.udpPortNumber" at <"bind-address">: invalid value; expected string
```
helpers function
```
{{- define "influxdb.udpPortNumber" -}}
{{ default 8089 (regexReplaceAll ":([0-9]+)" (index .Values "config" "udp" "bind-address") "${1}") }}
{{- end -}}
```
The problem can be fixed with the following snippet. But this is only a temporary solution, because the default value is set wrong by the helpers functions.
temporary solution
```
config:
udp:
enabled: true
bind-address: ":8089"
```
Another solution: add `| quote ` in the helpers function (supplementary for all ports):
```
{{- define "influxdb.udpPortNumber" -}}
{{ default 8089 (regexReplaceAll ":([0-9]+)" (index .Values "config" "udp" "bind-address" | quote ) "${1}") }}
{{- end -}}
```
Contributor guide
Research direction
Start in charts/influxdb/templates/_helpers.tpl, especially influxdb.udpPortNumber, and inspect its use from charts/influxdb/templates/statefulset.yaml. Run Helm template with config.udp.enabled set and no bind-address, then verify the chart renders the default UDP port and handles the other port helpers consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- helm, kubernetes
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- Half a day
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100