From 3f8e5fd388c0d3b5f2fef5a1674ecd2b40a880a3 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed <fawzi.mohamed@fhi-berlin.mpg.de> Date: Thu, 22 Nov 2018 16:20:15 +0100 Subject: [PATCH] fix deletion of containers (was deleting *all* containers after upgrading the client library...) --- app/k8-data.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/k8-data.js b/app/k8-data.js index 09c4c39..e711aa1 100644 --- a/app/k8-data.js +++ b/app/k8-data.js @@ -184,7 +184,7 @@ function getOrCreatePod(podName, repl, shouldCreate, next) { next(error, null) } else if (pod.status && ['Error', 'Failed', 'Succeeded'].includes(pod.status.phase)) { if (shouldCreate) { - k8.api.v1.ns(config.k8component.namespace).pods.delete({ name: podName }).then(function (delResult) { + k8.api.v1.ns(config.k8component.namespace).pod(podName).delete().then(function (delResult) { logger.info(`Deleted stopped pod ${podName} to restart it`) createPod(podName, repl, next) // wait & return 'pod shutting down' instead? }, function(err) { @@ -327,7 +327,7 @@ function guaranteeResolvePod(repl, res, next){ function deletePod(podName, next) { - k8.api.v1.ns(config.k8component.namespace).pods.delete({ name: podName }).then(function (result) { + k8.api.v1.ns(config.k8component.namespace).pod(podName).delete().then(function (result) { resolveCache.set(podName, undefined) logger.info(`deleted pod ${podName}`) next(null, result.body) -- GitLab