Remove a pipelinerun if cleanup is about to start

This commit is contained in:
2024-04-04 09:45:24 +02:00
parent 0d33733693
commit 3a55008066
2 changed files with 9 additions and 1 deletions

View File

@ -28,7 +28,12 @@ else
export SP_CUSTOMER_ID=$(jq -r .[0].object.metadata.namespace $BINDING_CONTEXT_PATH)
export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH)
echo "removing the ${SP_ENVIRONMENT} owned by ${SP_CUSTOMER_ID}"
# -- Remove the pipelinerun, if not removed yet
kubectl delete pipelinerun -n "${SP_TEKTON_RUNTIME_NS}" \
-l softplayer.net/user-uuid="${SP_CUSTOMER_ID}" \
-l softplayer.net/env_name="${SP_ENVIRONMENT}" || true
envsubst < /tpls/${SP_PROVIDER}-cleanup.yaml | kubectl create -f -
# -- Removing the finalizer