Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement(k8s): also delete metadata namespace when cleaning up #1268

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions garden-service/src/plugins/kubernetes/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { KubeApi, KubernetesError } from "./api"
import { getAppNamespace, prepareNamespaces, deleteNamespaces } from "./namespace"
import { getAppNamespace, prepareNamespaces, deleteNamespaces, getMetadataNamespace } from "./namespace"
import { KubernetesPluginContext, KubernetesConfig } from "./config"
import { checkTillerStatus, installTiller } from "./helm/tiller"
import {
Expand Down Expand Up @@ -233,13 +233,14 @@ export async function cleanupEnvironment({ ctx, log }: CleanupEnvironmentParams)
const k8sCtx = <KubernetesPluginContext>ctx
const api = await KubeApi.factory(log, k8sCtx.provider)
const namespace = await getAppNamespace(k8sCtx, log, k8sCtx.provider)
const metadataNamespace = await getMetadataNamespace(k8sCtx, log, k8sCtx.provider)
const entry = log.info({
section: "kubernetes",
msg: `Deleting namespace ${namespace} (this may take a while)`,
status: "active",
})

await deleteNamespaces([namespace], api, entry)
await deleteNamespaces([namespace, metadataNamespace], api, entry)

return {}
}
Expand Down