1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/main/cluster-detectors/version-detector.ts
Panu Horsmalahti 1477bb8274 Enforce semicolons in eslint
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
2020-11-19 16:35:04 +02:00

17 lines
488 B
TypeScript

import { BaseClusterDetector } from "./base-cluster-detector";
import { ClusterMetadataKey } from "../cluster";
export class VersionDetector extends BaseClusterDetector {
key = ClusterMetadataKey.VERSION
value: string
public async detect() {
const version = await this.getKubernetesVersion();
return { value: version, accuracy: 100};
}
public async getKubernetesVersion() {
const response = await this.k8sRequest("/version");
return response.gitVersion;
}
}