rancher / capi-ui-extension

Rancher Extension used in rancher/dashboard for Rancher Turtles CAPI Provisioning UI.
Apache License 2.0
8 stars 7 forks source link

Create Infra Provider form uses cache values from other forms/pages #45

Closed valaparthvi closed 2 months ago

valaparthvi commented 2 months ago

While creating an infrastructure provider, I noticed it uses cache values from other forms/pages, mainly for namespaces and cloud credentials.

Version Information: CAPI UI: v0.4.0 RT: v0.6.0 Rancher: v2.8-head(59bef33)

Steps to reproduce:

  1. Add at least 2 cloud credentials.
  2. Create an infrastructure provider. Note the values for namespace(=default) and cloud credential.
  3. Go to continuous delivery, change the namespace to fleet-local and add a repo.
  4. Start creating another infrastructure provider.
  5. Note the namespace value, it should now be fleet-local instead of default. Note the cloud credential value, it's value is the cloud credentials ID selected previously. (There is another bug here, where it displays the cloudcred ID instead of name which is not very user friendly.)

Apparently it only takes the value set in the Cluster Management page and is not affected by other pages.

Screenshot from 2024-04-15 15-08-59

eva-vashkevich commented 2 months ago

The cloudcred id being shown instead of name seems to be Amazon-specific and can be seen in the rest of dashboard as well. I will open a bug there Edit: Or maybe not. It still looks like a dashboard issue and not CAPI ui issue

valaparthvi commented 2 months ago

The cloudcred id being shown instead of name seems to be Amazon-specific and can be seen in the rest of dashboard as well. I will open a bug there Edit: Or maybe not. It still looks like a dashboard issue and not CAPI ui issue

Yes, I noticed that too. It does not appear the first time you create provider, but on second attempt or when creating an Azure provider, it does.

eva-vashkevich commented 2 months ago

Hi @valaparthvi are you still able to reproduce it on latest version?

eva-vashkevich commented 2 months ago

Also, if credential is created without providing a name, which is not mandatory, we will be just displaying ID. I think I saw credentials that have a name be shown as ids, but I can't reproduce that, so will need to keep an eye on that happening

valaparthvi commented 2 months ago

@eva-vashkevich I cannot reproduce the issue for cloud credentials, but I can still see that the issue is true for namespace.

When I first create a provider, the selected namespace is default, but if I go to Continuous delivery, select fleet-local add a repository, come back to create a provider, the selected namespace becomes fleet-local. If I select any other namespace and create the provider, the next time I open create provider form, the namespace value is the one selected previously.

Screencast from 05-09-2024 12:59:59 PM.webm

eva-vashkevich commented 2 months ago

I believe this is expected behavior of the cloud credentials. It uses the ns that was last used because we assume that the user would want to continue using that same namespace. @mantis-toboggan-md could you please confirm that this is intentional?

mantis-toboggan-md commented 2 months ago

That's correct @eva-vashkevich this is intentional behavior across the dashboard.

eta: the last-used namespace is saved as a user preference then referenced here

eva-vashkevich commented 2 months ago

Closing as this is intentional behavior and the other issue is no longer reproducible.