-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Fakeclient: Add apply support #2981
base: main
Are you sure you want to change the base?
Conversation
This change is a POC for adding apply patch support to the fake client. This relies on the upstream support for this which is implemented in a new [FieldManagedObjectTracker][0]. There are two major problems with this for us though: 1. It requires a [type converter][1] which gets initialized with a [parser][2] that knows how the type look like. It doesn't look like it is possible to pass multiple parsers, which means the resulting client can only deals with the set of types the parser knows about, for example what is in client-go but it will not work with CRDs 2. We have some code that wants to look at the object after it was patched to check if its valid - Since this is implemented in the tracker, it doesn't look like its possible to dry run the patch [0]: https://github.com/kubernetes/kubernetes/blob/4dc7a48ac6fb631a84e1974772bf7b8fd0bb9c59/staging/src/k8s.io/client-go/testing/fixture.go#L643 [1]: https://github.com/kubernetes/kubernetes/blob/4dc7a48ac6fb631a84e1974772bf7b8fd0bb9c59/staging/src/k8s.io/client-go/applyconfigurations/utils.go#L1739 [2]: https://github.com/kubernetes/kubernetes/blob/4dc7a48ac6fb631a84e1974772bf7b8fd0bb9c59/staging/src/k8s.io/client-go/applyconfigurations/internal/internal.go#L28
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR needs rebase. 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. |
I don't think this change should be merged, but leaving it here for future reference before I forget about it.
Ref #2341
This change is a POC for adding apply patch support to the fake client.
This relies on the upstream support for this which is implemented in a new FieldManagedObjectTracker. There are two major problems with this for us though: