Add script to delete pipeline runs from tekton.

This commit is contained in:
Tom Alexander 2024-04-06 11:29:38 -04:00
parent 08454740d6
commit df81196035
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
kubectl get pipelinerun --all-namespaces -o go-template='{{range .items}}{{.metadata.namespace}}/{{.metadata.name}}{{"\n"}}{{end}}' | while read p; do namespace=$(cut -d '/' -f 1 <<<"$p"); name=$(cut -d '/' -f 2 <<<"$p"); kubectl delete pipelinerun -n "$namespace" "$name"; done

View File

@ -37,6 +37,8 @@
dest: /usr/local/bin/kx
- src: decrypt_k8s_secret
dest: /usr/local/bin/decrypt_k8s_secret
- src: k8s_delete_pipeline_runs
dest: /usr/local/bin/
- import_tasks: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"'