Skip to content

Instantly share code, notes, and snippets.

@ikurni
Created September 22, 2020 06:39
Show Gist options
  • Save ikurni/d69ddef919a488e038ba5a14b9c3408a to your computer and use it in GitHub Desktop.
Save ikurni/d69ddef919a488e038ba5a14b9c3408a to your computer and use it in GitHub Desktop.
Force OCP Project Deletion if Stuck in Terminating
## Get namespace information on json format ###
oc get namespace <namespacename> -o json > tmp.json
### Edit file tmp.json, remove "kubernetes" on the finalizer section, left [] behind ###
vi tmp.json
### Save and Exit ###
### Run below command to hit API via proxy ###
oc proxy
### Open another shell terminal, while keep "oc proxy" terminal in other session###
### Run below command to force remove the project ###
curl -k -H "Content-Type: application/json" -X PUT --data-binary @tmp.json http://127.0.0.1:8001/api/v1/namespaces/namespacename/finalize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment