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
Sebastian Malton b2616d4cf2 Turn on strict mode for TS
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2021-04-13 20:06:11 -04:00

19 lines
476 B
TypeScript

import { BaseClusterDetector } from "./base-cluster-detector";
import { ClusterMetadataKey } from "../cluster";
export class VersionDetector extends BaseClusterDetector {
key = ClusterMetadataKey.VERSION;
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;
}
}