2025-04-10 09:14:16 +00:00

26 lines
639 B
YAML

apiVersion: tekton.dev/v1
kind: Task
metadata:
name: after-pipeline
spec:
params:
- name: pvcName
type: string
default: ""
description: |
The name of the PVC to delete. If empty, no action will be taken.
steps:
- name: maybe-delete-pvc
image: bitnami/kubectl:latest
script: |
#!/bin/sh
set -e
if [ -n "$(params.pvcName)" ]; then
echo "🔧 Deleting PVC: $(params.pvcName)"
kubectl delete pvc $(params.pvcName) || echo "⚠️ PVC not found: $(params.pvcName)"
else
echo "✅ No PVC to delete (pvcName is empty)"
fi