mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add guards to prevent activation errors slipping through (#5845)
* Add guards to prevent activation errors slipping through Signed-off-by: Sebastian Malton <sebastian@malton.name> * Make sure all logging has a message, output less errors when prometheus fails Signed-off-by: Sebastian Malton <sebastian@malton.name> * Improve logging from getPortFromStream Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
0d2aea0101
commit
81c18a6cad
8 files changed
+43
-17
No files matched your search
@@ -340,15 +340,35 @@ export class Cluster implements ClusterModel, ClusterState {
|
||||
}
|
||||
|
||||
if (this.disconnected || !this.accessible) {
|
||||
await this.reconnect();
|
||||
try {
|
||||
this.broadcastConnectUpdate("Starting connection ...");
|
||||
await this.reconnect();
|
||||
} catch (error) {
|
||||
this.broadcastConnectUpdate(`Failed to start connection: ${error}`, true);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.broadcastConnectUpdate("Refreshing connection status ...");
|
||||
await this.refreshConnectionStatus();
|
||||
try {
|
||||
this.broadcastConnectUpdate("Refreshing connection status ...");
|
||||
await this.refreshConnectionStatus();
|
||||
} catch (error) {
|
||||
this.broadcastConnectUpdate(`Failed to connection status: ${error}`, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.accessible) {
|
||||
this.broadcastConnectUpdate("Refreshing cluster accessibility ...");
|
||||
await this.refreshAccessibility();
|
||||
try {
|
||||
this.broadcastConnectUpdate("Refreshing cluster accessibility ...");
|
||||
await this.refreshAccessibility();
|
||||
} catch (error) {
|
||||
this.broadcastConnectUpdate(`Failed to refresh accessibility: ${error}`, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// download kubectl in background, so it's not blocking dashboard
|
||||
this.ensureKubectl()
|
||||
.catch(error => this.dependencies.logger.warn(`[CLUSTER]: failed to download kubectl for clusterId=${this.id}`, error));
|
||||
|
||||
@@ -78,4 +78,4 @@ export default winston.createLogger({
|
||||
format.simple(),
|
||||
),
|
||||
transports,
|
||||
});
|
||||
}) as Logger;
|
||||
Reference in new issue
Block a user