genreconciler
: successful finalization breaks status updates
#2519
Labels
area/API
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/frozen
Indicates that an issue or PR should not be auto-closed due to staleness.
/area API
/kind bug
This is a largely superficial issue, which I only noticed because of some unit testing I was writing and trying to explain this odd behavior.
Expected Behavior
If in
FinalizeKind
a resource is markedReady
, andnil
is returned, then we see both updates (path for finalizer, update status forReady
).Actual Behavior
Instead the finalizer is removed and the status is NOT updated.
The bug
Using
Deployment
as an example... If inFinalizeKind
we update status andreturn nil
then we will call through here:pkg/client/injection/kube/reconciler/apps/v1beta1/deployment/reconciler.go
Lines 242 to 244 in bfab3c8
This function uses the input
resource
(with the updated status) to access the finalizers, find ours and remove it:pkg/client/injection/kube/reconciler/apps/v1beta1/deployment/reconciler.go
Lines 438 to 441 in bfab3c8
The resource we pass in is used to compute a
PATCH
on the finalizers specifically:pkg/client/injection/kube/reconciler/apps/v1beta1/deployment/reconciler.go
Lines 373 to 378 in bfab3c8
However, any other mutations (e.g. our status update) are ignored here. This is a problem because the
resource
that is returned by this function is the updated copy that is returned by thePATCH
which does not have our status update reflected:pkg/client/injection/kube/reconciler/apps/v1beta1/deployment/reconciler.go
Lines 388 to 396 in bfab3c8
The text was updated successfully, but these errors were encountered: