UNPKG

@catladder/cli

Version:

Panter cli tool for cloud CI/CD and DevOps

22 lines (20 loc) 614 B
import { defineCommand } from "../../core/defineCommand"; import { getk8sApi } from "../../k8sApi"; export const commandKubeListSecrets = defineCommand({ name: "k8s list-secrets", description: "show secrets", group: "general", inputs: { namespace: { type: "string", message: "kubernetes namespace", positional: true, }, }, execute: async (ctx) => { const namespace = await ctx.get("namespace"); const k8sApi = getk8sApi(); const res = await k8sApi.listNamespacedSecret(namespace); ctx.log(res.body.items.map((n: any) => n.metadata.name).join("\n")); }, });