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