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

[backport v2.10.0] Use semver.coerce() to get valid kubernetes version #12533

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 7, 2024

This is an automated request to port PR #12532 by @rak-phillip

Original PR body:

Summary

Fixes #12531

Occurred changes and/or fixed issues

This uses semver.coerce() to get a valid semantic version for the original Kubernetes version in CruAks.vue. The form could fail to render if the Kubernetes version is not a valid semver and semver.coerce() will correctly evaluate to a semantic version.

Technical notes summary

In the production example, 1.29 is used for the Kubernetes version:

az aks create --resource-group th-rg --no-ssh-key --kubernetes-version 1.29 --name th-az-imported-293 --node-count 1 --location eastus

1.29 is a valid Kubernetes version and will default to the latest release1 (1.29.10 at the time of writing).

1.29 is stored in aksConfig.kubernetesVersion; this is not a valid semver, so an unhandled exception is thrown and the page fails to render correctly.

It's entirely possible that current-cluster-controllers-version is the incorrect value to use for this case, but it was the only one that I found that evaluates to a valid semver with the expected kubernetes version of 1.29.10.

Areas or cases that should be tested

  • See reproduction steps in issue

Areas which could experience regressions

We are changing the Kubernetes version used for the AKS form. If this annotation doesn't exist for any reason, we will experience the same behavior that's described in the issue. We can consider adding some sort of failure mode if the original Kubernetes isn't present or a valid semver. We can also consider adding some sort of fallback value in the event that it fails.

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

Footnotes

  1. https://kubernetes.io/releases/#release-v1-29

When creating AKS clusters, `1.29` is a valid kubernetes version that can be supplied to provision a cluster with the latest patch version. Unfortunately, `aksConfig?.kubernetesVersion` only stores `1.29` and the fully compatible semantic version is unknown. With the information we have available to us, we can utilize `semver.coerce()` to at least attempt to infer a Kubernetes version with the information that we have available to us.

Signed-off-by: Phillip Rak <[email protected]>
@rak-phillip rak-phillip merged commit f9cdb12 into release-2.10 Nov 7, 2024
27 checks passed
@rak-phillip rak-phillip deleted the gha-portpr-11715215957-1 branch November 7, 2024 03:10
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.

[backport v2.10.0] [v2.10.0] Unable to Edit Config of imported Azure AKS cluster
2 participants