mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Convert initializing to observable and ensure it is set to false after init
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
74b7a228a1
commit
589cdc8a3d
@ -76,7 +76,6 @@ export class Cluster implements ClusterModel, ClusterState {
|
|||||||
* If extension sets this it needs to also mark cluster as enabled on activate (or when added to a store)
|
* If extension sets this it needs to also mark cluster as enabled on activate (or when added to a store)
|
||||||
*/
|
*/
|
||||||
public ownerRef: string;
|
public ownerRef: string;
|
||||||
public initializing = false;
|
|
||||||
protected kubeconfigManager: KubeconfigManager;
|
protected kubeconfigManager: KubeconfigManager;
|
||||||
protected eventDisposers: Function[] = [];
|
protected eventDisposers: Function[] = [];
|
||||||
protected activated = false;
|
protected activated = false;
|
||||||
@ -85,6 +84,14 @@ export class Cluster implements ClusterModel, ClusterState {
|
|||||||
whenInitialized = when(() => this.initialized);
|
whenInitialized = when(() => this.initialized);
|
||||||
whenReady = when(() => this.ready);
|
whenReady = when(() => this.ready);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is cluster object initializinng on-going
|
||||||
|
*
|
||||||
|
* @observable
|
||||||
|
*/
|
||||||
|
@observable initializing = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is cluster object initialized
|
* Is cluster object initialized
|
||||||
*
|
*
|
||||||
@ -279,7 +286,6 @@ export class Cluster implements ClusterModel, ClusterState {
|
|||||||
this.kubeconfigManager = await KubeconfigManager.create(this, this.contextHandler, port);
|
this.kubeconfigManager = await KubeconfigManager.create(this, this.contextHandler, port);
|
||||||
this.kubeProxyUrl = `http://localhost:${port}${apiKubePrefix}`;
|
this.kubeProxyUrl = `http://localhost:${port}${apiKubePrefix}`;
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
this.initializing = false;
|
|
||||||
logger.info(`[CLUSTER]: "${this.contextName}" init success`, {
|
logger.info(`[CLUSTER]: "${this.contextName}" init success`, {
|
||||||
id: this.id,
|
id: this.id,
|
||||||
context: this.contextName,
|
context: this.contextName,
|
||||||
@ -290,6 +296,8 @@ export class Cluster implements ClusterModel, ClusterState {
|
|||||||
id: this.id,
|
id: this.id,
|
||||||
error: err,
|
error: err,
|
||||||
});
|
});
|
||||||
|
} finally {
|
||||||
|
this.initializing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user