-
Notifications
You must be signed in to change notification settings - Fork 1.2k
⚠️ Fakeclient: Clear typemeta for structured #3229
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
Conversation
[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 |
d6c17b7
to
f8773da
Compare
The fakeclient currently differs from the liveclient in that if a structured object is created that has typemeta set, it will retain that. In contrast to that, the liveclient always strips it. This change makes the fakeclient strip it just like the live client.
/hold cancel |
/lgtm |
LGTM label has been added. Git tree hash: a49c7a92a457cad8c7b312b1d5588225f9280bf8
|
/lgtm |
The required fixed are the following: * The function RESTClientForGVK has introduced the `forceDisableProtoBuf` field. The code base has been adjusted to set this field as `false` where is is used. * Fake client now strips the TypeMeta fields kubernetes-sigs/controller-runtime#3229. Therefore, it is required to adjust how the cache gets the `Kind` field, otherwise, the field is empty and objects are not cached. Signed-off-by: Javier Cano Cano <[email protected]>
The required fixes are the following: * The function RESTClientForGVK has introduced the `forceDisableProtoBuf` field. The code base has been adjusted to set this field as `false` where is used. * Fake client now strips the TypeMeta fields kubernetes-sigs/controller-runtime#3229. Therefore, it is required to adjust how the cache gets the `Kind` field, otherwise, the field is empty and objects are not cached. Signed-off-by: Javier Cano Cano <[email protected]>
Hello @alvaroaleman |
It happens in the decoder: kubernetes/kubernetes#80609 Any code that assumes presence of type meta on objects is prone to become problematic, because if someone does |
The fakeclient currently differs from the liveclient in that if a
structured object is created that has typemeta set, it will retain that.
In contrast to that, the liveclient always strips it.
This change makes the fakeclient strip it just like the live client.
Based on top of #3228 which needs to merge first.
Noticed this while working on #2981
/hold