Fox scripts

This commit is contained in:
Nikolai Rodionov 2024-04-03 09:56:47 +02:00
parent eb03484d56
commit 6c7d167d78
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
2 changed files with 8 additions and 8 deletions

View File

@ -17,8 +17,8 @@ kubernetes:
values: ["bootstrap"]
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)
PROVIDER=$(jq -r .[0].object.data.provider $BINDING_CONTEXT_PATH)
KUBERNETES=$(jq -r .[0].object.data.kubernetes $BINDING_CONTEXT_PATH)
echo "running the ${PROVIDER}-cleanup hook"
if ! [ -f /tpls/${PROVIDER}-cleanup.yaml ]; then
@ -26,8 +26,8 @@ else
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)
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}"
envsubst < /tpls/${PROVIDER}-cleanup.yaml | kubectl create -f -

View File

@ -22,14 +22,14 @@ kubernetes:
values: ["bootstrap"]
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)
PROVIDER=$(jq -r .[0].object.data.provider $BINDING_CONTEXT_PATH)
KUBERNETES=$(jq -r .[0].object.data.kubernetes $BINDING_CONTEXT_PATH)
if ! [ -f /tpls/${PROVIDER}-${KUBERNETES}.yaml ]; then
echo "ERROR: template not found for ${PROVIDER}-${KUBERNETES}"
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)
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)
envsubst < /tpls/${PROVIDER}-${KUBERNETES}.yaml | kubectl create -f -
kubectl patch configmap -n ${SP_CUSTOMER_ID} ${SP_ENVIRONMENT} \
-p '{"metadata":{"finalizers":["softplayer.net/bootstrapped"]}}' --type=merge