pingidentity / helm-charts

Apache License 2.0
22 stars 31 forks source link

Universally Handle SemVer Pre-Release Versions for EKS #278

Closed StokesM closed 9 months ago

StokesM commented 9 months ago

When using AWS EKS the reported K8s version always has a SemVer pre-release specifier that AWS use for their own versioning on top of the standard K8s version.

The SemVer comparison library that Helm uses ignored pre-release versions unless the format of the comparator specifically includes a pre-release specifier.

This has already been done for the ingress template where the API version is selected with:

{{- if semverCompare ">=1.19-0" $top.Capabilities.KubeVersion.Version }}
apiVersion: networking.k8s.io/v1
{{- else }}
apiVersion: networking.k8s.io/v1beta1
{{- end }}

For our case this also need to be done for the HPA template to support EKS, but should probably also be done for all SemVer comparisons against the K8s version:

For reference: https://helm.sh/docs/chart_template_guide/function_list/#working-with-prerelease-versions

StokesM commented 9 months ago

The solution mentioned by @mwhittlestone2 in issue #280 is a better solution for all of the cases I have mentioned here.