helm
helm copied to clipboard
coredns.containerPorts template helper does not properly handle missing ports
trafficstars
In charts/coredns/templates/configmap.yaml, port is allowed to be missing:
{{- if .port }}:{{ .port }} {{ end -}}
However, in charts/coredns/templates/_helpers.tpl, there is no check if the port is missing, only a call to toString:
{{- $port := toString .port -}}
When templated, this produces containerPorts like this:
- containerPort: <nil>
name: udp-<nil>
protocol: UDP
- containerPort: <nil>
name: tcp-<nil>
protocol: TCP
The workaround is to explicitly specify the default port 53
/assign