Skip to content

Commit

Permalink
fix: add missing lines
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
  • Loading branch information
leninmehedy committed Jan 26, 2024
1 parent d8af4b8 commit 96d8ee0
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion fullstack-network-manager/src/commands/network.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ export class NetworkCommand extends BaseCommand {

self.configManager.load(argv)
const namespace = self.configManager.getFlag(flags.namespace)
const deletePvcs = self.configManager.getFlag(flags.deletePvcs)
ctx.config = {
namespace: await prompts.promptNamespaceArg(task, namespace)
namespace: await prompts.promptNamespaceArg(task, namespace),
deletePvcs: await prompts.promptDeletePvcs(task, deletePvcs)
}
}
},
Expand All @@ -209,6 +211,24 @@ export class NetworkCommand extends BaseCommand {
task: async (ctx, _) => {
await self.chartManager.uninstall(ctx.config.namespace, constants.CHART_FST_DEPLOYMENT_NAME)
}
},
{
title: 'Get PVCs for namespace',
task: async (ctx, _) => {
if (ctx.config.deletePvcs === true) {
ctx.config.pvcs = await self.k8.listPvcsByNamespace(ctx.config.namespace)
}
}
},
{
title: 'Delete PVCs for namespace',
task: async (ctx, _) => {
if (ctx.config.pvcs) {
for (const pvc of ctx.config.pvcs) {
await self.k8.deletePvc(pvc, ctx.config.namespace)
}
}
}
}
], {
concurrent: false,
Expand Down

0 comments on commit 96d8ee0

Please sign in to comment.