dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Custom RKE2 | Unexpected Sorting of K8s Version | Blocking Upgrade

Open brudnak opened this issue 4 years ago • 5 comments

Setup

  • Rancher version: 2.6.3-rc5
  • Browser type & version: Google Chrome 96.0.4664.55 (Official Build) (x86_64)

Describe the bug

When creating a Custom RKE2 cluster there is a k8s version not being sorted as an expected. When trying to upgrade the cluster from v1.21.7rke2r2 to v1.21.7-rc2+rke2r3. The v1.21.7-rc2+rke2r3 version is greyed out and unable to be selected.

v1.21.7-rc2+rke2r3 is > v1.21.7rke2r2

To Reproduce

  1. Create a custom RKE2 cluster with v1.21.7rke2r2
  2. Try to upgrade the custom RKE2 cluster from v1.21.7rke2r2 to v1.21.7-rc2+rke2r3

Result

v1.21.7-rc2+rke2r3 is sorted after v1.21.7rke2r2. When trying to upgrade the cluster the v1.21.7-rc2+rke2r3 is disabled and unavailable to select as an upgrade option.

Expected Result

To be able to upgrade from v1.21.7rke2r2 to v1.21.7-rc2+rke2r3

Screenshots

dropdown-list

sort

Additional context

The UI is making these sortable with utils/sort as:

v1.21.7rke2r2 = 0000000001.0000000021.0000000007.rke0000000002r0000000002

v1.21.7-rc2+rke2r3 = 0000000001.0000000021.0000000007.rc0000000002.rke0000000002r0000000003

brudnak avatar Dec 15 '21 18:12 brudnak

This is the correct behavior, 1.21.7-anything is by (semver) definition less than 1.21.7. They are the same major/minor/patch, adding a hyphen makes it a prerelease, and all prereleases are less than the same tag without a prerelease. The -rcX should go after the + so that it is part of the metadata instead of a prerelease marker.

vincent99 avatar Dec 15 '21 20:12 vincent99

The extending out the numbers thing with lots of leading zeros is not relevant to this, that just makes it so that the standard string sort (which is a lot faster than providing a custom one) will preserve lexographic ordering of numbers (i.e. 1, 2 ... 10, 11, 12) instead of 'ASCII-betical' order (1, 10, 11, 12, 2, 3 ...)

vincent99 avatar Dec 15 '21 20:12 vincent99

I need to file an RKE2 ticket to fix semver.

gaktive avatar Dec 15 '21 20:12 gaktive

Filed https://github.com/rancher/rke2/issues/2272 to address semver.

In light of the current state of the versions listed, independent of this UI issue, we'll push this out to 2.6.4.

gaktive avatar Dec 15 '21 21:12 gaktive

New backend ticket for more Team 2 tracking: https://github.com/rancher/rancher/issues/39303

gaktive avatar Oct 14 '22 19:10 gaktive

Tracking now back to RKE2 repo: https://github.com/rancher/rke2/issues/2272 as the other backend ticket was closed as a duplicate.

gaktive avatar Nov 18 '22 19:11 gaktive

Pushing to Q4 as Q3 timeline is tight. Will check with RKE2 team about plans.

gaktive avatar Jun 17 '23 00:06 gaktive

Per @caroline-suse-rancher, a hyphen should never be in a release in the UI for rke2 anymore.

"For more explanation, if we re-release a version it is always an r2, r3, etc. in the case of rke2 and an s2, s3, etc. in the case of k3s. So, for instance, if we have the first release of v1.24.16+rke2r1, then need to re-release it would become v1.24.16+rke2r2 , rc stands for "release candidate", so it should never be shipped with the official release."

gaktive avatar Jul 21 '23 16:07 gaktive

@brudnak This is and old issue - is this still relevant?

nwmac avatar Aug 10 '23 09:08 nwmac

@brudnak This is and old issue - is this still relevant?

From these comments, https://github.com/rancher/dashboard/issues/4776#issuecomment-1645977267, and https://github.com/rancher/dashboard/issues/4776#issuecomment-995180030 think you can close this issue @nwmac

brudnak avatar Aug 10 '23 15:08 brudnak

based on Andrew's comment, will close this issue.

FYI @nwmac @gaktive

aalves08 avatar Aug 25 '23 11:08 aalves08