Skip to content

Commit

Permalink
Fix cluster dashboard opening when cluster is initially offline (#1044)
Browse files Browse the repository at this point in the history
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
  • Loading branch information
nevalla authored Oct 7, 2020
1 parent 62e1829 commit 57f013d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ export class Cluster implements ClusterModel {
this.refreshEvents(),
this.refreshAllowedResources(),
]);
if (!this.ready) {
this.ready = true
}
}
this.pushState();
}
Expand Down Expand Up @@ -234,7 +237,7 @@ export class Cluster implements ClusterModel {
const apiUrl = this.kubeProxyUrl + path;
return request(apiUrl, {
json: true,
timeout: 5000,
timeout: 30000,
...options,
headers: {
Host: `${this.id}.${new URL(this.kubeProxyUrl).host}`, // required in ClusterManager.getClusterForRequest()
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/cluster-manager/cluster-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { hasLoadedView } from "./lens-views";
export class ClusterView extends React.Component {
render() {
const cluster = getMatchedCluster();
const showStatus = cluster && (!cluster.available || !hasLoadedView(cluster.id))
const showStatus = cluster && (!cluster.available || !hasLoadedView(cluster.id) || !cluster.ready)
return (
<div className="ClusterView">
{showStatus && (
Expand Down

0 comments on commit 57f013d

Please sign in to comment.