controller-runtime
controller-runtime copied to clipboard
Add a util method to recognize if resource in reconcile loop is being deleted
I noticed there is no common method so I see a lot of if xxx.,metadata.deletionTimestamp...
logic, I thin it would be profitable to add utility method like isBeingDeleted(object)
to determine that.
WDYT ?
For me, it's still a one-liner to do obj.GetDeletionTimestamp().IsZero()
, so this feels like overkill.
+1 bc I think complex controllers are increasingly coon and this would reduce cognitive load on outsiders trying to reason about a controllers logic
For me, it's still a one-liner to do
obj.GetDeletionTimestamp().IsZero()
, so this feels like overkill.
+1. And you can see this logic everywhere in the core k/k repo, I don't see anyone feels pain or wants to put it into a utility method.