Search code examples
kubernetes-helmsemantic-versioning

helm3: semVersion comparison fails in Chart.yaml for version which has "rc"


In Chart.yaml

I have kubeVersion: ">=1.10.1"

Cluster nodes have below version

v1.18.0-rc.1 and helm installation fails with error

Error: chart requires kubeVersion: >=1.10.1 which is incompatible with Kubernetes v1.18.0-rc.1

I tried changing kubeVersion to 1.10.1-rc.1 but some new error

error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into Go value of type releaseutil.SimpleHead
# helm version
version.BuildInfo{Version:"v3.1.2", GitCommit:"d878d4d45863e42fd5cff6743294a11d28a9abce", GitTreeState:"clean", GoVersion:"go1.13.8"}

Solution

  • To allow prereleases (such as rc), at least in Helm, the constraints suffix needs to be -0. For example, >=1.20.0-0 will allow versions greater or equal to 1.20.0, including any prereleases.