From 74f1008de0c22d28c545845f105b50063d28025c Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 29 Nov 2021 12:51:56 -0500 Subject: [PATCH] Update debug log Signed-off-by: Sebastian Malton --- src/common/k8s-api/kube-watch-api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/k8s-api/kube-watch-api.ts b/src/common/k8s-api/kube-watch-api.ts index a97fc81c9e..63636eddc3 100644 --- a/src/common/k8s-api/kube-watch-api.ts +++ b/src/common/k8s-api/kube-watch-api.ts @@ -147,11 +147,11 @@ export class KubeWatchApi { ? reaction( // Note: must slice because reaction won't fire if it isn't there () => [KubeWatchApi.context.contextNamespaces.slice(), KubeWatchApi.context.hasSelectedAll] as const, - ([namespaces, curSelectedAll], [, prevSelectedAll]) => { + ([namespaces, curSelectedAll], [prevNamespaces, prevSelectedAll]) => { if (curSelectedAll && prevSelectedAll) { - console.log(`[KUBE-WATCH-API]: Not changing watch for ${store.api.apiBase} because a new namespace was created but all namespaces are selected`); + const action = namespaces.length > prevNamespaces.length ? "created" : "deleted"; - return; + return console.debug(`[KUBE-WATCH-API]: Not changing watch for ${store.api.apiBase} because a new namespace was ${action} but all namespaces are selected`); } console.log(`[KUBE-WATCH-API]: changing watch ${store.api.apiBase}`, namespaces);