Conversation
There was a problem hiding this comment.
Thanks for the contribution — small, focused change and the core logic is right. One blocker before this can merge.
nodePort is missing from values.yaml. The README values table documents server.stunService.nodePort, but charts/netbird/values.yaml (the stunService block around L416–419) still only declares type, port, and annotations. The convention in this chart is that every documented value is present in values.yaml with a # -- comment — that's what users discover via helm show values, and what drives the generated values table. Please add something like:
stunService:
type: LoadBalancer
port: 3478
# -- Fixed NodePort to assign when type is NodePort. Omit/null to let
# Kubernetes allocate one from the nodePort range (default 30000–32767).
nodePort: null
annotations: {}Two non-blocking nits left inline on the test file. Happy to re-review once the values.yaml entry is in.
| - contains: | ||
| path: spec.ports | ||
| content: | ||
| name: stun | ||
| port: 3478 | ||
| targetPort: stun | ||
| protocol: UDP |
There was a problem hiding this comment.
Weak negative-case assertion. helm-unittest's contains is a subset match on array elements — it will pass whether or not nodePort is present, so this doesn't actually verify the guard. Tighten by asserting the field is absent, e.g.:
asserts:
- isNull:
path: spec.ports[0].nodePort| port: 3478 | ||
| targetPort: stun | ||
| protocol: UDP | ||
| nodePort: 30478 |
There was a problem hiding this comment.
Missing test: NodePort type with nodePort unset. There's no case for type: NodePort without an explicit nodePort value — i.e. that the template omits the field and lets Kubernetes allocate. The and guard in the template depends on that path, so worth locking in a case right after this one.
adds stunService.nodePort
I like specifying
NodePort.I could not do this with the existing chart.