rancher / dashboard

The Rancher UI
https://rancher.com
Apache License 2.0
450 stars 257 forks source link

RKE2/K3s - Default versions are marked as experimental when editing an imported RKE2 cluster #5409

Closed jiaqiluo closed 2 years ago

jiaqiluo commented 2 years ago

Setup

Describe the bug

When editing an imported RKE2 cluster, Default versions are marked as experimental in the dropdown list of versions. This bug happens in a very specific scenario, please see the following steps for reproducing.

To Reproduce

Result

screencapture-143-198-141-42-dashboard-c-local-manager-provisioning-cattle-io-cluster-fleet-default-rke2-1-21-9-2022-03-15-19_00_12

We can see that all 1.22.x versions are marked as experimental. However, if we go to the cluster-creation page, we can see that the default version is 1.22.7+rke2r1

screencapture-143-198-141-42-dashboard-c-local-manager-provisioning-cattle-io-cluster-create-2022-03-15-19_00_45

More Info (Update: this assumption is not correct. see https://github.com/rancher/dashboard/issues/5409#issuecomment-1072783562) This bug might be related to the fact that none of the minor versions which are the same as the latest version defined in the KDM is available for rancher v2.6.3:

As the following shows, v1.23.4+rke2r2 is the latest version defined in the KDM

channels:
  - name: default
    latest: v1.23.4+rke2r2

However, v1.23.4+rke2r2 is not available for rancher v2.6.3 because of its minChannelServerVersion

  - version: v1.23.4+rke2r2
    minChannelServerVersion: v2.6.4-alpha1
    maxChannelServerVersion: v2.6.99

Also, v1.23.4+rke2r2 is the only existing 1.23.x version. As the result, the UI shows 1.22.7+rke2r1 as the default version because it is the highest available version below 1.23.4+rke2r2 in rancher 2.6.3

Here is the file defines the rules for RKE2 that is used to generate the KDM for this issue: https://github.com/jiaqiluo/kontainer-driver-metadata/blob/dashboard-5409/channels-rke2.yaml

snasovich commented 2 years ago

Maybe the logic for determining which versions should be marked as Experimental for imported clusters is different, need input from UI team on this.

jiaqiluo commented 2 years ago

This test indicates that the bug is NOT related to the fact that none of the minor versions which are the same as the latest version defined in the KDM is available for rancher v2.6.3.

Steps:

Result: 1.22.x are marked as experimental

Screen Shot 2022-03-18 at 1 28 54 PM
snasovich commented 2 years ago

This is indeed a non-issue as for imported cluster Ember UI is used and "experimental" label is added by the following code: https://github.com/rancher/ui/blob/86aaea0ef9fc54c23f3bc8bb8cb69108062a109c/lib/shared/addon/components/managed-import-cluster-info/component.js#L86

This is driven by supported k8s versions range set in ui-k8s-supported-versions-range setting provided by Rancher backend which in turn is calculated on the fly based on KDM data per https://github.com/rancher/rancher/blob/364f746bb650057e74dd385db96873bed2adcd73/pkg/controllers/management/kontainerdrivermetadata/data.go#L682

From my understanding this calculation is done based on versions that are already filtered based on version-constrained configuration in KDM, e.g. like this for 2.6.3: https://github.com/rancher/kontainer-driver-metadata/blob/a11d25f5ba6f0d114ac366236969c5e0497d1304/rke/k8s_version_info.go#L35

Closing this issue based on this research.

cc: @jiaqiluo @kinarashah @catherineluse