rancher / dashboard

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

Cluster Management -> Clusters -> Edit Config form for Hosted Kubernetes clusters does not save changes to Labels or Annotations #7631

Closed gaktive closed 1 year ago

gaktive commented 1 year ago

Internal reference: SURE-5640 Reported in 2.6.9 & 2.7.0

Issue description: The Cluster Management -> Clusters -> Edit Config form for Hosted Kubernetes clusters does not save changes to Labels or Annotations

Impact: Unable to add new cluster labels or annotations to cluster via the Cluster Management -> Edit Config form, the 'Save' submission for the form does not return an error, but updates do not take effect. Confusing to users attempt to add labels to cluster for Fleet targetting for example.

Repro steps:

Workaround: Labels and Annotations can be added to Hosted Kubernetes Clusters successfully via the Continuous Delivery -> Clusters -> Edit Config form, or via the v3 API

Actual behavior: Attempts to add Labels or Annotations to Hosted Kubernetes clusters via the Cluster Management -> Edit Config form do not succeed and no error is returned

Expected behavior: Attempts to add Labels or Annotations to Hosted Kubernetes clusters via the Cluster Management -> Edit Config form succeed

nwmac commented 1 year ago

Confirmed this on an Azure cluster

thaneunsoo commented 1 year ago

Test Environment:

Rancher version: v2.7-head 9bb8d56 Rancher cluster type: HA Docker version: 20.10

Downstream cluster type: hosted cluster


Testing:

Tested this issue with the following steps:

  1. Provision a Rancher v2.6.9 instance (I used github.com/superseb/tf-do-rancher2)
  2. Provision an EKS/GKE/AKS cluster and add an initial label oncreate:foo
  3. Observe oncreate:foo label present on the cluster after creation
  4. Navigate to Cluster Management -> Clusters -> Edit Config for the cluster, and add to add a fresh Label or Annotation, complete Configure Cluster steps in the rest of the form and click 'Save'. Do so with browser developer tools open and observe the put requests to /v3/clusters/ does not contain the new label/annotation in the labels or annotations maps.
  5. Observe that the freshly added label/annotation is absent from the cluster.

Result The label is now being saved on the hosted cluster. image.png The label after cluster creation is also preserved image.png