Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change semverCompare in PDB #448

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Change semverCompare in PDB #448

merged 1 commit into from
Oct 31, 2023

Conversation

ognyvrac
Copy link
Contributor

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:
image

.Capabilities.KubeVersion.GitVersion looks at the GitVersion of the Kubernetes cluster; in our case that is a GKE cluster which has the GitVersion of GitVersion:"v1.24.16-gke.500" (retrieved by running kubectl 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 or 1.24.0, and GitVersions with a pre-release, such as 1.20.0-alpha and v1.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.

Signed-off-by: ognyvrac <[email protected]>
Copy link
Member

@sjhx sjhx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

positive contribution, thanks

@sjhx sjhx added this pull request to the merge queue Oct 31, 2023
Merged via the queue into IBM:main with commit 431e96b Oct 31, 2023
2 checks passed
@ognyvrac ognyvrac deleted the ognyvrac-patch-1 branch November 24, 2023 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants