Bobby Impollonia
Bobby Impollonia

Reputation: 155

What is Helm's version comparison logic?

When using "helm install" without explicitly specifying a version, helm defaults to using the "newest" version. However, I have not found documentation on the logic it uses to sort version numbers (what is considers "newest") and its behavior has surprised me.

In particular, I have a project that is potentially moving to a date-based versioning scheme and I find that Helm considers version 2021.04.06.23.28.07-de7dafa6 to be lower than 1.0.2. I expected that since the "major" component (before the first dot) of the first one is 2021, it would be treated as a higher version than something with a "major" version of 1.

Btw, I am aware of the existence of semver and its benefit and understand that using that might make it so that helm would do the right thing. However, I am still hoping someone can explain what the logic is that helm uses for comparing two version numbers for newness.

Upvotes: 1

Views: 3310

Answers (1)

taleodor
taleodor

Reputation: 2061

Helm requires you to use SemVer - see here https://helm.sh/docs/topics/charts/#charts-and-versioning

So you cannot use CalVer with Helm unfortunately.

Regarding version comparison logic please see here - https://helm.sh/docs/chart_template_guide/function_list/#semantic-version-functions

Upvotes: 1

Related Questions