UNPKG

@catladder/cli

Version:

Panter cli tool for cloud CI/CD and DevOps

13 lines (9 loc) 378 B
import { exec } from "child-process-promise"; export const getCurrentContext = async () => (await exec(`kubectl config current-context`)).stdout.trim(); export const getCurrentConnectedClusterName = async () => { return await getCurrentContext(); }; export const connectToCluster = async (fullname: string) => { await exec(`kubectl config use-context ${fullname}`); };