From fc45f06fc8bc34e52ae4221703e2cc5872a1eda1 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 6 May 2022 09:18:47 -0400 Subject: [PATCH] Add some debug logging to help debug LED issue (#5288) --- src/main/cluster-manager.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/cluster-manager.ts b/src/main/cluster-manager.ts index 1991ce8ea1..498884785d 100644 --- a/src/main/cluster-manager.ts +++ b/src/main/cluster-manager.ts @@ -144,22 +144,32 @@ export class ClusterManager extends Singleton { } else { entity.status.phase = (() => { if (!cluster) { + logger.debug(`${logPrefix} setting entity ${entity.getName()} to DISCONNECTED, reason="no cluster"`); + return LensKubernetesClusterStatus.DISCONNECTED; } if (cluster.accessible) { + logger.debug(`${logPrefix} setting entity ${entity.getName()} to CONNECTED, reason="cluster is accessible"`); + return LensKubernetesClusterStatus.CONNECTED; } if (!cluster.disconnected) { + logger.debug(`${logPrefix} setting entity ${entity.getName()} to CONNECTING, reason="cluster is not disconnected"`); + return LensKubernetesClusterStatus.CONNECTING; } // Extensions are not allowed to use the Lens specific status phases if (!lensSpecificClusterStatuses.has(entity?.status?.phase)) { + logger.debug(`${logPrefix} not clearing entity ${entity.getName()} status, reason="custom string"`); + return entity.status.phase; } + logger.debug(`${logPrefix} setting entity ${entity.getName()} to DISCONNECTED, reason="fallthrough"`); + return LensKubernetesClusterStatus.DISCONNECTED; })();