mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
21 lines
470 B
TypeScript
21 lines
470 B
TypeScript
// Get cluster info
|
|
|
|
import { kubeRequest } from "./kube-request";
|
|
import { IClusterInfo } from "../common/cluster"
|
|
|
|
export async function getClusterInfo(): Promise<IClusterInfo> {
|
|
const [kubeVersion] = await Promise.all([
|
|
getKubeVersion().catch(() => null),
|
|
]);
|
|
return {
|
|
kubeVersion,
|
|
};
|
|
}
|
|
|
|
export async function getKubeVersion() {
|
|
const res = await kubeRequest<{ gitVersion: string }>({
|
|
path: "/version",
|
|
});
|
|
return res.gitVersion.slice(1);
|
|
}
|