rancher / dashboard

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

Badge background color doesn't change from Explore/Edit Cluster Badge #10674

Open momesgin opened 7 months ago

momesgin commented 7 months ago

Setup

Describe the bug

When customizing the badge background color of a cluster during its creation process, the color becomes visible correctly after the cluster transitions to the active state. However, if you navigate to the cluster's explorer page and click on 'Edit Cluster Badge' to change the color again, it does not update as expected.

Note: You can still set color via 'Edit Cluster Badge' button in the cluster explorer if you didn’t set it during cluster creation.

To Reproduce

  1. Start creating a new cluster with any provider
  2. Write at least three letters for its name to enable 'Customize', then click on it to open the modal
  3. Change the badge background color and click the Apply button
  4. Wait until the cluster becomes active, then go to its Explorer page and Click on 'Edit Cluster Badge'
  5. Change the badge background color again and click the Apply button

Result

Expected Result

Screenshots

https://github.com/rancher/dashboard/assets/135728925/3e3d2f0b-398f-4d6c-bf3b-7a52b2bb6a62

Additional context

This issue is probably related to the explorer button using v3 clusters. We have an open issue about syncing between the different cluster objects https://github.com/rancher/dashboard/issues/9563

gaktive commented 5 months ago

It's possible that we're either not setting or looking properly to the management cluster. Perhaps we're setting that this is set on the provisioning cluster and we're expecting a background process to then sync to the management cluster.

gaktive commented 5 months ago

This may be a possible regression so if we can't solve this for 2.9.0, we may have to remove the option to set the colour badge on creation until we sort this out.

jordojordo commented 5 months ago

Upon some initial testing, this doesn't appear to be a frontend issue. The request is being sent properly with the correct response from the backend, but the annotation does not appear to be saved. This applies to all of the annotations for the badge ui.rancher/badge*. I could not find any errors in the server logs either.

You can manually create the request from the /v3/clusters/<cluster-id> endpoint of your cluster:

https://github.com/rancher/dashboard/assets/40806497/274db380-20c1-43d6-96f5-24be1f9b08b1

gaktive commented 1 month ago

Need to file a backend ticket for this.