softplayer-controller/hooks/cleanup-pipelineruns.sh

28 lines
692 B
Bash
Raw Normal View History

2024-04-03 09:35:54 +00:00
#!/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