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

Add some debug logging to help debug LED issue (#5288)

This commit is contained in:
Sebastian Malton 2022-05-06 09:18:47 -04:00 committed by GitHub
parent fdf65e8ab6
commit fc45f06fc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,22 +144,32 @@ export class ClusterManager extends Singleton {
} else { } else {
entity.status.phase = (() => { entity.status.phase = (() => {
if (!cluster) { if (!cluster) {
logger.debug(`${logPrefix} setting entity ${entity.getName()} to DISCONNECTED, reason="no cluster"`);
return LensKubernetesClusterStatus.DISCONNECTED; return LensKubernetesClusterStatus.DISCONNECTED;
} }
if (cluster.accessible) { if (cluster.accessible) {
logger.debug(`${logPrefix} setting entity ${entity.getName()} to CONNECTED, reason="cluster is accessible"`);
return LensKubernetesClusterStatus.CONNECTED; return LensKubernetesClusterStatus.CONNECTED;
} }
if (!cluster.disconnected) { if (!cluster.disconnected) {
logger.debug(`${logPrefix} setting entity ${entity.getName()} to CONNECTING, reason="cluster is not disconnected"`);
return LensKubernetesClusterStatus.CONNECTING; return LensKubernetesClusterStatus.CONNECTING;
} }
// Extensions are not allowed to use the Lens specific status phases // Extensions are not allowed to use the Lens specific status phases
if (!lensSpecificClusterStatuses.has(entity?.status?.phase)) { if (!lensSpecificClusterStatuses.has(entity?.status?.phase)) {
logger.debug(`${logPrefix} not clearing entity ${entity.getName()} status, reason="custom string"`);
return entity.status.phase; return entity.status.phase;
} }
logger.debug(`${logPrefix} setting entity ${entity.getName()} to DISCONNECTED, reason="fallthrough"`);
return LensKubernetesClusterStatus.DISCONNECTED; return LensKubernetesClusterStatus.DISCONNECTED;
})(); })();