softplayer-controller/hooks/cleanup-pipelineruns.sh
2024-04-03 11:35:54 +02:00

28 lines
692 B
Bash

#!/usr/bin/env bash
if [[ $1 == "--config" ]] ; then
cat <<EOF
configVersion: v1
kubernetes:
- name: Watch bootstrap configmaps getting removed
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
executeHookOnSynchronization: false
executeHookOnEvent: ["Modified"]
jqFilter: ".status."
labelSelector:
matchExpressions:
- key: "component"
operator: "In"
values: ["bootstrap"]
EOF
else
# -------------------------------------------------------------------
# If status is succeeded, remove pipelinerun
# If failed, print a warning (till we have a notification system)
# -------------------------------------------------------------------
echo todo
fi