mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
b2002baedc
commit
635efc737f
2 files changed
+2
-3
No files matched your search
@@ -31,7 +31,7 @@ export class DistributionDetector extends BaseClusterDetector {
|
|||||||
if (this.isCustom()) {
|
if (this.isCustom()) {
|
||||||
return { value: "custom", accuracy: 10}
|
return { value: "custom", accuracy: 10}
|
||||||
}
|
}
|
||||||
return { value: "vanilla", accuracy: 10}
|
return { value: "unknown", accuracy: 10}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getKubernetesVersion() {
|
public async getKubernetesVersion() {
|
||||||
|
|||||||
@@ -5,13 +5,12 @@ export class NodesCountDetector extends BaseClusterDetector {
|
|||||||
key = ClusterMetadataKey.NODES_COUNT
|
key = ClusterMetadataKey.NODES_COUNT
|
||||||
|
|
||||||
public async detect() {
|
public async detect() {
|
||||||
|
if (!this.cluster.accessible) return null;
|
||||||
const nodeCount = await this.getNodeCount()
|
const nodeCount = await this.getNodeCount()
|
||||||
return { value: nodeCount, accuracy: 100}
|
return { value: nodeCount, accuracy: 100}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async getNodeCount(): Promise<number> {
|
protected async getNodeCount(): Promise<number> {
|
||||||
if (!this.cluster.accessible) return null;
|
|
||||||
|
|
||||||
const response = await this.k8sRequest("/api/v1/nodes")
|
const response = await this.k8sRequest("/api/v1/nodes")
|
||||||
return response.items.length
|
return response.items.length
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user