You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Object doesn't get updated after Client.Delete(object) #3059
fakeClient.Delete(obj) doesn't update deletionTimestamp of the obj passed to the function. The bug is in fakeClient.deleteObject, since it gets a new object and updates the new object without rewriting the original object.
changed the title [-]Object doesn't get updated after fakeClient.Delete[/-][+]object doesn't get updated after fakeClient.Delete(object)[/+]on Jan 3, 2025
Yeah. I think I noticed this 1-2 months ago in a unit test. First I thought the fake client is the problem but then I saw that the real client has the same behavior :)
Yeah. I think I noticed this 1-2 months ago in a unit test. First I thought the fake client is the problem but then I saw that the real client has the same behavior :)
Do we want to change the real client behavior and then map that to the fakeClient?
From my testing, If there's a finalizer on the resource then you will get a response including the timestamp, otherwise it gets deleted, and there's no deletion timestamp.
changed the title [-]object doesn't get updated after fakeClient.Delete(object)[/-][+]Object doesn't get updated after Client.Delete(object)[/+]on Sep 13, 2025
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Activity
[-]Object doesn't get updated after fakeClient.Delete[/-][+]object doesn't get updated after fakeClient.Delete(object)[/+]sbueringer commentedon Jan 7, 2025
I assume the regular client updates it? (I think I remember that the regular client also doesn't update it, but I'm not sure)
alvaroaleman commentedon Jan 7, 2025
Actually it looks like it doesn't:
controller-runtime/pkg/client/typed_client.go
Line 86 in 8e44a43
So after someone deletes an object, their in-mem representation doesn't reflect that? That is different from all other methods and very confusing
sbueringer commentedon Jan 7, 2025
Yeah. I think I noticed this 1-2 months ago in a unit test. First I thought the fake client is the problem but then I saw that the real client has the same behavior :)
troy0820 commentedon Jan 8, 2025
I can take this one if you all don't mind.
/assign @troy0820
sbueringer commentedon Jan 9, 2025
I'm wondering if there are comparable cases in client-go and how they are handled there
troy0820 commentedon Jan 13, 2025
/unassign @troy0820
I unfortunately do not have the time to commit to work through the PR for this. I am going to unassign myself for anyone who wants to take this.
troy0820 commentedon Jan 28, 2025
Do we want to change the real client behavior and then map that to the fakeClient?
sbueringer commentedon Jan 28, 2025
I think knowing ^^ would be good to inform our decision.
Do we get the object with deletionTimestamp back when we do the actual delete call?
troy0820 commentedon Jan 28, 2025
I don't think we do unless I am reading this wrong on the dynamic client which uses the rest.Interface.
https://github.com/kubernetes/client-go/blob/f2030849e1d6d961fa150b9be9560da33e5d00df/dynamic/simple.go#L205-L219
sbueringer commentedon Jan 28, 2025
Looks like it. Not sure if there either simply is nothing in the response body or if we just don't read it
bigkevmcd commentedon Jan 28, 2025
I think simply modifying
typedClient.Delete()From my testing, If there's a finalizer on the resource then you will get a response including the timestamp, otherwise it gets deleted, and there's no deletion timestamp.
9 remaining items
alvaroaleman commentedon Sep 13, 2025
Retitling as this doesn't affect just the fake client:
/retitle Object doesn't get updated after Client.Delete(object)
[-]object doesn't get updated after fakeClient.Delete(object)[/-][+]Object doesn't get updated after Client.Delete(object)[/+]k8s-triage-robot commentedon Dec 12, 2025
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/staleis appliedlifecycle/stalewas applied,lifecycle/rottenis appliedlifecycle/rottenwas applied, the issue is closedYou can:
/remove-lifecycle stale/closePlease send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
k8s-triage-robot commentedon Jan 11, 2026
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/staleis appliedlifecycle/stalewas applied,lifecycle/rottenis appliedlifecycle/rottenwas applied, the issue is closedYou can:
/remove-lifecycle rotten/closePlease send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
k8s-triage-robot commentedon Feb 10, 2026
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
lifecycle/staleis appliedlifecycle/stalewas applied,lifecycle/rottenis appliedlifecycle/rottenwas applied, the issue is closedYou can:
/reopen/remove-lifecycle rottenPlease send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
k8s-ci-robot commentedon Feb 10, 2026
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
alvaroaleman commentedon Feb 10, 2026
/reopen
/lifecycle frozen
k8s-ci-robot commentedon Feb 10, 2026
@alvaroaleman: Reopened this issue.
Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.