nextcloud / helm

A community maintained helm chart for deploying Nextcloud on Kubernetes.
GNU Affero General Public License v3.0
334 stars 269 forks source link

Don't require `nodePort` to template if none is specified #606

Closed jessebot closed 2 months ago

jessebot commented 3 months ago

Description of the change

The actual port that the NodePort type service uses can be automatically generated if no nodeport field is specified, as per the docs here: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport

Benefits

We now use a with instead of an if to make the code a bit cleaner, instead of setting the nodePort to "" which I think may also be confusing and/or not work.

Possible drawbacks

none that I can think of, but always open to feedback :)

Applicable issues

Additional information

The actual value of nil in values.yaml has to change, otherwise, it interprets the nil as a string.

Checklist

jessebot commented 3 months ago

oh no, why are all these tests failing? 🤔 Looks like it's because of this error:

Service in version "v1" cannot be handled as a Service: json: cannot unmarshal string into Go struct field ServicePort.spec.ports.nodePort of type int32

Let me see if I can fix it locally...

jessebot commented 3 months ago

ok, the fix was remove the nil from the values.yaml for the nodePort helm parameter 👍