@catladder/cli
Version:
Panter cli tool for cloud CI/CD and DevOps
15 lines • 820 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.connectToCluster = exports.getCurrentConnectedClusterName = exports.getCurrentContext = void 0;
const child_process_promise_1 = require("child-process-promise");
const getCurrentContext = async () => (await (0, child_process_promise_1.exec)(`kubectl config current-context`)).stdout.trim();
exports.getCurrentContext = getCurrentContext;
const getCurrentConnectedClusterName = async () => {
return await (0, exports.getCurrentContext)();
};
exports.getCurrentConnectedClusterName = getCurrentConnectedClusterName;
const connectToCluster = async (fullname) => {
await (0, child_process_promise_1.exec)(`kubectl config use-context ${fullname}`);
};
exports.connectToCluster = connectToCluster;
//# sourceMappingURL=cluster.js.map