Remove a pipelinerun if cleanup is about to start
This commit is contained in:
parent
0d33733693
commit
3a55008066
@ -28,7 +28,12 @@ else
|
|||||||
export SP_CUSTOMER_ID=$(jq -r .[0].object.metadata.namespace $BINDING_CONTEXT_PATH)
|
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)
|
export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH)
|
||||||
echo "removing the ${SP_ENVIRONMENT} owned by ${SP_CUSTOMER_ID}"
|
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 -
|
envsubst < /tpls/${SP_PROVIDER}-cleanup.yaml | kubectl create -f -
|
||||||
|
|
||||||
# -- Removing the finalizer
|
# -- Removing the finalizer
|
||||||
|
@ -3,6 +3,9 @@ kind: PipelineRun
|
|||||||
metadata:
|
metadata:
|
||||||
generateName: hetzner-k3s
|
generateName: hetzner-k3s
|
||||||
namespace: "${SP_TEKTON_RUNTIME_NS}"
|
namespace: "${SP_TEKTON_RUNTIME_NS}"
|
||||||
|
labels:
|
||||||
|
softplayer.net/user-uuid: "${SP_CUSTOMER_ID}"
|
||||||
|
softplayer.net/env_name: "${SP_ENVIRONMENT}"
|
||||||
spec:
|
spec:
|
||||||
params:
|
params:
|
||||||
- name: namespace
|
- name: namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user