@catladder/cli
Version:
Panter cli tool for cloud CI/CD and DevOps
26 lines (25 loc) • 756 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.commandKubeListPods = void 0;
const defineCommand_1 = require("../../core/defineCommand");
const k8sApi_1 = require("../../k8sApi");
exports.commandKubeListPods = (0, defineCommand_1.defineCommand)({
name: "k8s list-pods",
description: "list all pods of namespace",
group: "general",
inputs: {
namespace: {
type: "string",
message: "kubernetes namespace",
positional: true
}
},
execute: async ctx => {
const namespace = await ctx.get("namespace");
const k8sApi = (0, k8sApi_1.getk8sApi)();
const res = await k8sApi.listNamespacedPod(namespace);
ctx.log(res.body.items.map(n => n.metadata.name).join("\n"));
}
});