mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
19 lines
492 B
TypeScript
19 lines
492 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;
|
|
}
|
|
} |