Created
February 27, 2020 09:23
-
-
Save jfblaine/9d05204ac8732d210f350e074376aec7 to your computer and use it in GitHub Desktop.
Remove terminating namespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #pass project name argument while running this shell script | |
| kubectl proxy & | |
| echo "Deleting the namespace $1" | |
| oc project $1 | |
| oc delete --all all,secret,pvc > /dev/null | |
| oc get ns $1 -o json > tempfile | |
| sed -i 's/"kubernetes"//g' tempfile | |
| curl --silent -H "Content-Type: application/json" -X PUT --data-binary @tempfile http://127.0.0.1:8001/api/v1/namespaces/"$1"/finalize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment