Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, we are experiencing some issues with the
semverCompare
logic inside the PDB of the Helm chart as it cannot handle the Kubernetes GitVersion for clusters on GKE.The output of running
kubectl version
:.Capabilities.KubeVersion.GitVersion
looks at the GitVersion of the Kubernetes cluster; in our case that is a GKE cluster which has the GitVersion ofGitVersion:"v1.24.16-gke.500"
(retrieved by runningkubectl version
). The issue stems from the-gke.500
which according to the Helm docs is considered as a pre-release.The solution provided seems to work both with GitVersion without a pre-release, such as
1.20.0
or1.24.0
, and GitVersions with a pre-release, such as1.20.0-alpha
andv1.21.0-beta.500-orca
.It should be considered that adding
-0
to the semverCompare string will be treated as a "pre-release" and that is not the case for GKE with its-gke.500
.Another solution that removes this "pre-release" concern could be
{{- if and (eq 1 (int .Capabilities.KubeVersion.Major)) (ge (int .Capabilities.KubeVersion.Minor) 21) -}}
- not as clean, but more understandable and error-proof.