coredns / coredns/helm

coredns.containerPorts template helper does not properly handle missing ports

Open
#67 1 comment 1 reaction 1 assignee Claimed by @shubham-cmyk View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.