diff --git a/src/plugins/kubernetes/actions.ts b/src/plugins/kubernetes/actions.ts index f79cd508df..b5dfc5878f 100644 --- a/src/plugins/kubernetes/actions.ts +++ b/src/plugins/kubernetes/actions.ts @@ -50,7 +50,7 @@ import { createNamespace, getAppNamespace, getMetadataNamespace, - getAllAppNamespaces, + getAllGardenNamespaces, } from "./namespace" import { KUBECTL_DEFAULT_TIMEOUT, @@ -141,12 +141,12 @@ export async function getServiceStatus(params: GetServiceStatusParams{}) } catch (err) { entry.setError(err.message) - const availableNamespaces = await getAllAppNamespaces(context) + const availableNamespaces = await getAllGardenNamespaces(context) throw new NotFoundError(err, { namespace, availableNamespaces }) } @@ -165,10 +165,8 @@ export async function destroyEnvironment({ ctx, provider, env }: DestroyEnvironm while (true) { await sleep(2000) - const status = await getEnvironmentStatus({ ctx, provider, env }) - - if (!status.configured) { - entry.setSuccess("Finished") + const nsNames = await getAllGardenNamespaces(context) + if (!nsNames.includes(namespace)) { break } diff --git a/src/plugins/kubernetes/namespace.ts b/src/plugins/kubernetes/namespace.ts index 90424c748b..71682c7c14 100644 --- a/src/plugins/kubernetes/namespace.ts +++ b/src/plugins/kubernetes/namespace.ts @@ -60,7 +60,7 @@ export function getMetadataNamespace(ctx: PluginContext, provider: KubernetesPro return `garden-metadata--${ctx.projectName}--${env.namespace}` } -export async function getAllAppNamespaces(context: string): Promise { +export async function getAllGardenNamespaces(context: string): Promise { const allNamespaces = await coreApi(context).listNamespace() return allNamespaces.body.items .map(n => n.metadata.name) diff --git a/static/bin/garden-debug b/static/bin/garden-debug new file mode 100755 index 0000000000..bc92b0d77c --- /dev/null +++ b/static/bin/garden-debug @@ -0,0 +1,5 @@ +#!/usr/bin/env node --inspect + +const cli = require("../../build/cli/cli") + +cli.run()