coredns.containerPorts template helper does not properly handle missing ports
Open
- Dominant language
- Mustache
- Stars
- 146
- Forks
- 145
- Avg merge
- 6d 5h
- Merged PRs (30d)
- 2
Description
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:
name: udp-
protocol: UDP
- containerPort:
name: tcp-
protocol: TCP
```
---
The workaround is to explicitly specify the default port `53`
Contributor guide
Assessment
This issue has not been assessed yet.