ManagedFieldsObjectTracker: Reload scheme#132004
ManagedFieldsObjectTracker: Reload scheme#132004k8s-ci-robot merged 1 commit intokubernetes:masterfrom
Conversation
In controller-runtime it is generally not expected to do any sort of scheme registration if unstructured.Unstructured is used. To make this work in the fakeclient, the fakeclient will register unstructured to scheme if the scheme doesn't recognize the GVK. This currently doesn't work with the `ManagedFieldsObjectTracker` as it never reloads the scheme. This change makes it reload the scheme in an inefficient but simple manner, which should be good enough for unit tests.
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The DetailsInstructions 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. |
|
/lgtm Thanks @alvaroaleman ! |
|
LGTM label has been added. DetailsGit tree hash: 70ebd4c00a3477ea1999db5fcb41b43890b6eb5d |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, jpbetz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/kind cleanup |
|
Even though this is primarily used for testing, the performance with this change is poor enough that its actually impacting our tests. We have a test that creates 5000 objects. Before: is there some compromise we can come to here on this? |
|
We could update this to allow configuring a mapper constructor func |
In controller-runtime it is generally not expected to do any sort of scheme registration if unstructured.Unstructured is used. To make this work in the fakeclient, the fakeclient will register unstructured to the scheme if the scheme doesn't recognize the GVK.
This currently doesn't work with the
ManagedFieldsObjectTrackeras it never reloads the scheme. This change makes it reload the scheme in an inefficient but simple manner, which should be good enough for unit tests.This change is required in order for controller-runtime to support SSA in the fakeclient, ref kubernetes-sigs/controller-runtime#2981
/sig api-machinery
/assign @jpbetz @sttts
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: