Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nickboldt/6dd4b94bf553b3bfaad57f94a9731750 to your computer and use it in GitHub Desktop.

Select an option

Save nickboldt/6dd4b94bf553b3bfaad57f94a9731750 to your computer and use it in GitHub Desktop.
kill running PLRs
oc get pipelineruns \
-n rhdh-tenant -l 'appstudio.openshift.io/application=rhdh-plugin-catalog-1' -o json | \
jq -r '.items[] | select(.status.conditions[0].reason == "Running" or .status.conditions[0].reason == "PipelineRunPending") | select(.metadata.name | test("-on-pull-")) | .metadata.name' \
| xargs -r -n 25 -P 4 sh -c 'for pr; do tkn pipelinerun cancel "$pr" -n rhdh-tenant 2>/dev/null || \
oc delete pipelinerun "$pr" -n rhdh-tenant --wait=false 2>/dev/null; done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment