Update scripts and templates
This commit is contained in:
parent
d4be11fd65
commit
eb03484d56
@ -7,6 +7,7 @@ kubernetes:
|
||||
- name: Watch bootstrap configmaps getting removed
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
executeHookOnSynchronization: false
|
||||
executeHookOnEvent: ["Modified"]
|
||||
jqFilter: ".metadata.deletionTimestamp"
|
||||
labelSelector:
|
||||
@ -18,13 +19,20 @@ EOF
|
||||
else
|
||||
PROVIDER=$(jq -r .[0].objects.[0].object.data.provider $BINDING_CONTEXT_PATH)
|
||||
KUBERNETES=$(jq -r .[0].objects.[0].object.data.kubernetes $BINDING_CONTEXT_PATH)
|
||||
echo "running the ${PROVIDER}-cleanup hook"
|
||||
|
||||
if ! [ -f /tpls/${PROVIDER}-cleanup.yaml ]; then
|
||||
echo "ERROR: template not found for ${PROVIDER}-cleanup"
|
||||
echo "template not found for ${PROVIDER}-cleanup"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export SP_CUSTOMER_ID=$(jq -r .[0].objects.[0].object.metadata.namespace $BINDING_CONTEXT_PATH)
|
||||
export SP_ENVIRONMENT=$(jq -r .[0].objects.[0].object.metadata.name $BINDING_CONTEXT_PATH)
|
||||
echo "removing the ${SP_ENVIRONMENT} owned by ${SP_CUSTOMER_ID}"
|
||||
|
||||
envsubst < /tpls/${PROVIDER}-cleanup.yaml | kubectl create -f -
|
||||
|
||||
# -- Removing the finalizer
|
||||
kubectl patch configmap -n ${SP_CUSTOMER_ID} ${SP_ENVIRONMENT} \
|
||||
-p '{"metadata":{"finalizers":null}}' --type=merge
|
||||
fi
|
||||
|
@ -12,6 +12,7 @@ kubernetes:
|
||||
- name: Watch bootstrap configmaps getting created
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
executeHookOnSynchronization: false
|
||||
executeHookOnEvent: ["Added", "Modified"]
|
||||
jqFilter: ".data"
|
||||
labelSelector:
|
||||
|
Loading…
Reference in New Issue
Block a user