Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Foreground stop all frameworks #3664

Merged
merged 2 commits into from
Sep 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/frameworkcontroller/deploy/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@

pushd $(dirname "$0") > /dev/null

/bin/bash stop.sh || exit $?
APISERVER=$(kubectl config view | grep server | cut -f 2- -d ":" | tr -d " ")
FRAMEWORK_ENDPOINT="$APISERVER/apis/frameworkcontroller.microsoft.com/v1/namespaces/default/frameworks"
until [[ $(curl -s $FRAMEWORK_ENDPOINT | jq ".items | length") -eq 0 ]]; do
echo 'Trying to stop all frameworks ...'
curl -X DELETE $FRAMEWORK_ENDPOINT \
-H "Content-Type: application/json" \
-d '{"kind":"DeleteOptions","apiVersion":"v1","propagationPolicy":"Foreground"}' > /dev/null 2>&1
sleep 5
done
kubectl delete customresourcedefinitions frameworks.frameworkcontroller.microsoft.com || exit $?

kubectl delete customresourcedefinitions frameworks.frameworkcontroller.microsoft.com
/bin/bash stop.sh || exit $?

popd > /dev/null