Skip to content

Commit

Permalink
fix: Prevent cleanup function from killing all jobs
Browse files Browse the repository at this point in the history
Cleanup function in the build image pipeline should only kill the relevant job, not all jobs

Signed-off-by: Ishaan Sehgal <ishaanforthewin@gmail.com>
  • Loading branch information
ishaansehgal99 authored Feb 13, 2024
1 parent 133cab3 commit 83597c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/preset-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@ jobs:
- name: Cleanup
if: ${{ always() }}
run: |
kubectl get job --no-headers -o custom-columns=":metadata.name" | grep "^docker-build-job" | xargs -r kubectl delete job
kubectl get pods --no-headers -o custom-columns=":metadata.name" | grep "^docker-build-job" | xargs -r kubectl delete pod
kubectl get job --no-headers -o custom-columns=":metadata.name" | grep "^docker-build-job-${{ matrix.model.name }}-[0-9]" | xargs -r kubectl delete job
kubectl get pods --no-headers -o custom-columns=":metadata.name" | grep "^docker-build-job-${{ matrix.model.name }}-[0-9]" | xargs -r kubectl delete pod

0 comments on commit 83597c0

Please sign in to comment.