There is a maintenance of MPCDF Gitlab on Thursday, April 22st 2020, 9:00 am CEST - Expect some service interruptions during this time

fix deletion of containers

(was deleting *all* containers after upgrading the client library...)
parent 399d98a8
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment