Skip to content

Instantly share code, notes, and snippets.

@weshayutin
weshayutin / clean_and_patch_finalizers.md
Last active November 20, 2025 16:02
clean_and_patch_finalizers.md

check setup

delete all backups

velero backup delete --all

delete restores

for i in oc get restore -A -o custom-columns=NAME:.metadata.name; do echo $i; oc patch restore $i -p '{"metadata":{"finalizers":null}}' --type=merge; done

delete repo maint jobs

oc get pods -n openshift-adp --field-selector=status.phase!=Running | grep repo-maintain-job | awk '{print $1}' | xargs -r oc delete pod -n openshift-adp