Skip to content

Instantly share code, notes, and snippets.

@PabloHiro
Created May 18, 2023 14:19
Show Gist options
  • Save PabloHiro/81f7862ae85bb859bba111ae6f87ea2b to your computer and use it in GitHub Desktop.
Save PabloHiro/81f7862ae85bb859bba111ae6f87ea2b to your computer and use it in GitHub Desktop.
Cleaning up Tekton pipeline runs

TEKTON HOUSEKEEPING

Delete failed pipelineruns:

kubectl -n target-namespace delete pipelinerun $(kubectl -n target-namespace get pipelinerun -o jsonpath='{range .items[?(@.status.conditions[*].status=="False")]}{.metadata.name}{"\n"}{end}')

Delete successful pipelineruns:

kubectl -n target-namespace delete pipelinerun $(kubectl -n target-namespace get pipelinerun -o jsonpath='{range .items[?(@.status.conditions[*].status=="True")]}{.metadata.name}{"\n"}{end}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment