⚠️ Fakeclient: Clear typemeta for structured #3229
⚠️ Fakeclient: Clear typemeta for structured #3229k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
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 DetailsNeeds 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. DetailsGit 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 <jcanocan@redhat.com>
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 <jcanocan@redhat.com>
|
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 |
Compare ownerRef/consumerRef groupversions, not TypeMeta, since controller runtime changes here kubernetes-sigs/controller-runtime#3229 Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
Compare ownerRef/consumerRef groupversions, not TypeMeta, since controller runtime changes here kubernetes-sigs/controller-runtime#3229 Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
CR fakeclient stripts typemeta as liveclient from v0.22.x kubernetes-sigs/controller-runtime#3229 Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
CR fakeclient stripts typemeta as liveclient from v0.22.x kubernetes-sigs/controller-runtime#3229 Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
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