lens
lens copied to clipboard
App crash when trying to connect to cluster that sometimes isn't there
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):
- Connect to a cluster that exists (and is found via kubeconfig sync)
- Navigate to the catalog
- Disconnect from that cluster using the 3 vertical dots menu
- Remove the kubeconfig file
- Using the navigate back arrows, go back one (to the cluster connect page)
- Open the dev tools and wait for the assertion to fail
- Recreate the kubeconfig file
- Click the "Reconnect" button
- 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:
-
renderer
(which is where the bug manifests) does not needapiUrl
at all