From 0d97ccd31751dee141a0ce3eec1cdb69a9d7626c Mon Sep 17 00:00:00 2001 From: cmaster11 Date: Tue, 28 Nov 2023 14:35:34 +0200 Subject: [PATCH] Just skip pods that are terminating --- src/locks.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/locks.ts b/src/locks.ts index a6ef4840..83b84de9 100644 --- a/src/locks.ts +++ b/src/locks.ts @@ -19,15 +19,17 @@ export async function isLocked( ) const imagesRaw = await runKubectl(kubernetesContext, [ 'get', - 'deploy', + 'pods', '--selector=canary!=true', '--no-headers', '-o', - 'custom-columns=NAME:.spec.template.spec.containers[*].image' + 'custom-columns=NAME:.spec.containers[*].image,PHASE:.status.phase' ]) const images = uniq( stringToArray(imagesRaw) .map(image => stringToArray(image, ',')) + .filter(([, phase]) => phase !== 'Succeeded' && phase !== 'Failed') + .map(([image]) => image) .flat() .filter(value => { return imageRegex.test(value)