Add plugin to remove finalizers (#2359)

* Add finalizer plugin

* Add explanation and authorship

* Move description and update plugin key to new k9s version
mine
Jose Alvarez 2023-12-26 22:11:12 +01:00 committed by GitHub
parent 34da44b441
commit 8debcab3eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
# Removes all finalizers from the selected resource. Finalizers are namespaced keys that tell Kubernetes to wait
# until specific conditions are met before it fully deletes resources marked for deletion.
# Before deleting an object you need to ensure that all finalizers has been removed. Usually this would be done
# by the specific controller but under some circumstances it is possible to encounter a set of objects blocked
# for deletion.
# This plugins makes this task easier by providing a shortcut to directly removing them all.
# Be careful when using this plugin as it may leave dangling resources or instantly deleting resources that were
# blocked by the finalizers.
# Author: github.com/jalvarezit
plugins:
remove_finalizers:
shortCut: Ctrl-F
confirm: true
scopes:
- all
description: |
Removes all finalizers from selected resource. Be careful when using it,
it may leave dangling resources or delete them
command: kubectl
background: true
args:
- patch
- --context
- $CONTEXT
- --namespace
- $NAMESPACE
- $RESOURCE_NAME
- $NAME
- -p
- '{"metadata":{"finalizers":null}}'
- --type
- merge