kubernetes-sigs / kubernetes-sigs/controller-runtime
Find one scalable pattern to wrap clients, and deprecate others
Open
@yindia is already working on this.
Since Aug 22, 2026.
help wanted
kind/feature
- Dominant language
- Go
- Stars
- 3k
- Forks
- 1.3k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 14
Description
As @sbueringer observed in https://github.com/kubernetes-sigs/controller-runtime/pull/2860#discussion_r1673871790,
we have, as of now, at least four different ways to wrap the client:
- intercept.NewClient
- NewDryRunClient
- WithFieldOwner
- WithStrictFieldValidation
... I think we should find a more scalable pattern to wrap clients.
If we continue to introduce a new wrapper for every single option we will end up with a lot of wrappers.If we continue to introduce a new wrapper for every single option we will end up with a lot of wrappers.
I guess the same way we could either:
- only have one wrapper taking various options and acting accordingly
- This also makes the options more discoverable for users
- Pretty sure we end up with more consistency then (see the list of wrappers below)
- add options to the main client (that's probalby not good because then they cannot be used with the fake client)
/kind feature
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.