Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 14, 2024

  1. ✨ Fakeclient: Add apply support

    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
    alvaroaleman committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    ac5705d View commit details
    Browse the repository at this point in the history