Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Add ability to delete finalizers #6

Open
todaywasawesome opened this issue Feb 17, 2022 · 2 comments
Open

[Feature request] Add ability to delete finalizers #6

todaywasawesome opened this issue Feb 17, 2022 · 2 comments

Comments

@todaywasawesome
Copy link

Maybe something like this? https://medium.com/pareture/script-to-force-remove-kubernetes-namespace-finalizer-57b72bd9460d

@bennesp
Copy link

bennesp commented Jun 8, 2023

I managed to delete all pending deletion resources blocked by a finalizer using this script:

finalizers | tail -n +2 | while read -r line; do
  namespace=$(echo "$line" | awk '{print $1}')
  name=$(echo "$line" | awk '{print $2}')
  kind=$(echo "$line" | awk '{print $4}')
  kubectl patch "$kind" "$name" -n "$namespace" --type=json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'
done

@kvaps
Copy link

kvaps commented Feb 4, 2024

finalizers | awk '{print "kubectl patch -n " $1 " " $4 "/" $2 " --type json --patch='\''[ { \"op\": \"remove\", \"path\": \"/metadata/finalizers\" } ]'\''" }' | sh -x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants