lens icon indicating copy to clipboard operation
lens copied to clipboard

App crash when trying to connect to cluster that sometimes isn't there

Open Nokel81 opened this issue 1 year ago • 0 comments

Describe the bug This is a follow up to https://github.com/lensapp/lens/pull/5881

The bug is as follows (without the above PR):

  1. Connect to a cluster that exists (and is found via kubeconfig sync)
  2. Navigate to the catalog
  3. Disconnect from that cluster using the 3 vertical dots menu
  4. Remove the kubeconfig file
  5. Using the navigate back arrows, go back one (to the cluster connect page)
  6. Open the dev tools and wait for the assertion to fail
  7. Recreate the kubeconfig file
  8. Click the "Reconnect" button
  9. Observe the blank screen after trying to connect.

The problem here is that the Cluster constructor expects some ClusterConfigData which the ClusterStore gets (on initial load) by attempting to read the kubeconfig file as described in the ClusterModel.

The PR above added some defensive code but it would be better to have a more robust solution that didn't require it.

Some things of note:

  1. renderer (which is where the bug manifests) does not need apiUrl at all

Nokel81 avatar Jul 25 '22 14:07 Nokel81