Don't remove finalizer on reschedule#49
Conversation
84adac3 to
c96294a
Compare
We need to be able to reschedule cleanup tasks without throwing errors and without removing the finalizer. The kube_runtime::finalizer helpers don't allow this, so we need to manage the finalizer ourselves.
c96294a to
7504ff3
Compare
doy-materialize
left a comment
There was a problem hiding this comment.
hrm, i'm really not a fan of reimplementing everything like this. what is the actual problem we're running into here? could we fix the callers instead? alternately, could we translate an Action::requeue into an error in the Event::Cleanup codepath? it really feels like there should be a way to get the behavior we want without fully just copying and pasting the code around like this.
|
We could convert it into an error, but that tends to spam logs. We don't want to have a bunch of error messages for what is actually a very normal event. Errors are also requeued immediately, which would make this spam much worse. We'd also have to handle this everywhere we use this library, and it leaves a very dangerous footgun that isn't obvious to users. There is nothing stopping a user from thinking that they are doing something reasonable by returning Ok(Action), but that silently removes the finalizer. Honestly, this should probably be fixed in the upstream kube-runtime. I'm going to open a PR there. |
|
yeah, if we can fix this upstream, that would be best. if that ends up not being possible, we could change the trait api here to prevent people from passing a requeue action (like, have |
We need to be able to reschedule cleanup tasks without throwing errors and without removing the finalizer. The kube_runtime::finalizer helpers don't allow this, so we need to manage the finalizer ourselves.