Wait until cluster is ready before initializing cluster dashboard (#748)

* Wait until cluster is ready before initializing cluster dashboard

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala authored and GitHub committed 2020-08-27 08:43:17 +03:00
1 parent c31004e677
commit 659d8bd0ab
3 files changed
+12 -9

No files matched your search

+6
View File
@@ -27,6 +27,7 @@ export interface ClusterState extends ClusterModel {
online: boolean;
disconnected: boolean;
accessible: boolean;
ready: boolean;
failureReason: string;
nodes: number;
eventCount: number;
@@ -47,6 +48,7 @@ export class Cluster implements ClusterModel {
protected eventDisposers: Function[] = [];
whenInitialized = when(() => this.initialized);
whenReady = when(() => this.ready);
@observable initialized = false;
@observable contextName: string;
@@ -56,6 +58,7 @@ export class Cluster implements ClusterModel {
@observable kubeProxyUrl: string; // lens-proxy to kube-api url
@observable online: boolean;
@observable accessible: boolean;
@observable ready: boolean;
@observable disconnected: boolean;
@observable failureReason: string;
@observable nodes = 0;
@@ -149,6 +152,7 @@ export class Cluster implements ClusterModel {
this.disconnected = true;
this.online = false;
this.accessible = false;
this.ready = false;
this.pushState();
}
@@ -172,6 +176,7 @@ export class Cluster implements ClusterModel {
this.refreshEvents(),
this.refreshAllowedResources(),
]);
this.ready = true
}
}
@@ -370,6 +375,7 @@ export class Cluster implements ClusterModel {
initialized: this.initialized,
apiUrl: this.apiUrl,
online: this.online,
ready: this.ready,
disconnected: this.disconnected,
accessible: this.accessible,
failureReason: this.failureReason,