rancher / dashboard

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

RKE2 Addon Config user values are not retained when switching tabs or editing a cluster #12418

Open mantis-toboggan-md opened 3 days ago

mantis-toboggan-md commented 3 days ago

Setup

Describe the bug It seems that users are unable to remove default values from rke2 addon configs. When the user switches away from the addon tab, default values are re-added. Some are re-added with a different value than they were initialized with, eg removing fields with empty string defaults results in them being re-added with null. Completely new fields are preserved.

Saving then editing a cluster also causes the ui to re-introduce default fields. If a user were to create a cluster with modified flannel configuration, edit it, view the flannel tab, and save, their configuration would be altered without them having explicitly done so.

To Reproduce 1 Navigate to the cluster manager cluster list, click create, ensure the rke toggle is set to RKE2/k3s, and select 'generic'

  1. Under 'Basics' change the container network to flannel
  2. Switch to the new 'Add-on: Flannel' tab
  3. Remove an item from the args array
  4. Switch to another tab
  5. Switch back to the flannel tab

Result The removed arg is present again when viewing the form

Expected Result User values are preserved

ALTERNATIVELY, after step 4

  1. without switching tabs Save the cluster and observe the network request: note that rkeConfig.chartValues.rke-flannel.flannel.args has only one item, as expected (you removed the other)
  2. Edit the cluster and select the flannel tab: args once again has the two default items

Screenshots

https://github.com/user-attachments/assets/1f42cd98-6911-401a-9750-ce00edf061d1

mantis-toboggan-md commented 3 days ago

I see this with 2.9-head code as well so it does not appear to be a vue3 related regression

richard-cox commented 3 days ago

I was concerned this might have been due to the recent split out of config to individual tabs but big is in 2.9.0. It may be more noticeable now though given the user may switch between tabs more.

gaktive commented 1 day ago

This blocks #12323 at least so this should be looked at soon. cc @nwmac