kubernetes-sigs / kubernetes-sigs/controller-runtime

Object doesn't get updated after Client.Delete(object)

Open
#3,059 25 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug lifecycle/frozen
Dominant language
Go
Stars
3k
Forks
1.3k
Avg merge
2d 5h
Merged PRs (30d)
14

Description

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.

Reference: https://github.com/kubernetes-sigs/controller-runtime/blob/v0.19.0/pkg/client/fake/client.go#L1085-L1095

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pkg/client/fake/client.go around lines 1085-1095 and inspect fakeClient.deleteObject, especially how the object passed to Delete relates to the newly obtained object. Check the existing fake-client tests, then verify that deleting through fakeClient.Delete(obj) updates the passed object's deletionTimestamp as well as the stored object.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.