Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Force remove CRD (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbochynski authored Nov 5, 2020
1 parent a02d719 commit 271bc0a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions remove-crd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function patch_obj() {
CRD=$1
NAME=$2
echo "CRD=$CRD"
echo "NAME=$NAME"
kubectl patch $CRD $NAME -p '{"metadata":{"finalizers":[]}}' --type=merge
}
function patch_all_crd() {
CRD=$1
echo "CRD to remove $CRD"
kubectl get $CRD -ojson | jq -r ".items[].metadata.name" | while read -r name; do patch_obj $CRD $name; done

}

kubectl get crd -ojson | jq -r '.items[].metadata.name' |grep kyma |while read -r line; do patch_all_crd $line ; done
2 changes: 2 additions & 0 deletions uninstall-kyma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ kubectl delete ns knative-eventing --force=true --wait=false
kubectl delete ns natss --force=true --wait=false
kubectl delete ns mocks --force=true --wait=false

./remove-crd.sh

echo "Kyma uninstalled in $(( $SECONDS/60 )) min $(( $SECONDS % 60 )) sec"

0 comments on commit 271bc0a

Please sign in to comment.