From 635efc737f2e138c0b3e857e15c4b4e8dc13cc89 Mon Sep 17 00:00:00 2001 From: Lauri Nevala Date: Fri, 30 Oct 2020 11:03:14 +0200 Subject: [PATCH] Update detectors Signed-off-by: Lauri Nevala --- src/main/cluster-detectors/distribution-detector.ts | 2 +- src/main/cluster-detectors/nodes-count-detector.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/cluster-detectors/distribution-detector.ts b/src/main/cluster-detectors/distribution-detector.ts index 139150112f..b5895f8a71 100644 --- a/src/main/cluster-detectors/distribution-detector.ts +++ b/src/main/cluster-detectors/distribution-detector.ts @@ -31,7 +31,7 @@ export class DistributionDetector extends BaseClusterDetector { if (this.isCustom()) { return { value: "custom", accuracy: 10} } - return { value: "vanilla", accuracy: 10} + return { value: "unknown", accuracy: 10} } public async getKubernetesVersion() { diff --git a/src/main/cluster-detectors/nodes-count-detector.ts b/src/main/cluster-detectors/nodes-count-detector.ts index 42ddf28742..858ff43d9f 100644 --- a/src/main/cluster-detectors/nodes-count-detector.ts +++ b/src/main/cluster-detectors/nodes-count-detector.ts @@ -5,13 +5,12 @@ export class NodesCountDetector extends BaseClusterDetector { key = ClusterMetadataKey.NODES_COUNT public async detect() { + if (!this.cluster.accessible) return null; const nodeCount = await this.getNodeCount() return { value: nodeCount, accuracy: 100} } protected async getNodeCount(): Promise { - if (!this.cluster.accessible) return null; - const response = await this.k8sRequest("/api/v1/nodes") return response.items.length }