Skip to content

Instantly share code, notes, and snippets.

@fabiorauber
Last active March 25, 2022 13:13
Show Gist options
  • Save fabiorauber/6d6d0603b8335b2511d0ebb38b7ae01e to your computer and use it in GitHub Desktop.
Save fabiorauber/6d6d0603b8335b2511d0ebb38b7ae01e to your computer and use it in GitHub Desktop.
Removes the finalizers from volumeattachments with a detachError
kubectl get volumeattachments \
-o=custom-columns='NAME:.metadata.name,UUID:.metadata.uid,NODE:.spec.nodeName,ERROR:.status.detachError' \
--no-headers | grep -vE '<none>$' | awk '{print $1}' | \
xargs -n1 kubectl patch -p '{"metadata":{"finalizers":[]}}' --type=merge volumeattachments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment