Skip to content

Commit

Permalink
Just skip pods that are terminating
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaster11 committed Nov 28, 2023
1 parent 9d248df commit 0d97ccd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/locks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0d97ccd

Please sign in to comment.