1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix trying to connect to cluster whose entity doesn't exist (#5881)

* Fix trying to connect to cluster whose entity doesn't exist

- If a Cluster is trying to be connected to but there is no associated
  entity then don't try and connect

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Revert cleanup

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-07-25 13:12:46 -04:00 committed by GitHub
parent 91235ca2c6
commit e7e8d1688c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,11 @@ class NonInjectedClusterView extends React.Component<Dependencies> {
bindEvents() {
disposeOnUnmount(this, [
reaction(() => this.clusterId, async (clusterId) => {
// TODO: replace with better handling
if (clusterId && !this.props.entityRegistry.getById(clusterId)) {
return this.props.navigateToCatalog(); // redirect to catalog when the clusterId does not correspond to an entity
}
this.props.clusterFrames.setVisibleCluster(clusterId);
this.props.clusterFrames.initView(clusterId);
requestClusterActivation(clusterId, false); // activate and fetch cluster's state from main