Skip to content

⚠️ Fakeclient: Remove support for objects with pointer meta #3228

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

Merged
merged 1 commit into from
May 28, 2025

Conversation

alvaroaleman
Copy link
Member

This change removes supports for objects that have type or object meta defined as pointer.

This is because the FieldManagedObjectTracker needed for support of SSA in the fakeclient can not support it, as it has a lot of places where it unconditionally accesses these fields using reflect, which will cause panics.

@k8s-ci-robot k8s-ci-robot requested a review from JoelSpeed May 26, 2025 21:48
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 26, 2025
@k8s-ci-robot k8s-ci-robot requested a review from troy0820 May 26, 2025 21:48
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 26, 2025
@alvaroaleman alvaroaleman changed the title :warn: Fakeclient: Remove support for objects with pointer meta ⚠️ Fakeclient: Remove support for objects with pointer meta May 26, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 26, 2025
This change removes supports for objects that have type or object meta
defined as pointer.

This is because the `FieldManagedObjectTracker` needed for support of
SSA in the fakeclient can not support it, as it has a lot of places
where it unconditionally accesses these fields using reflect, which will
cause panics.
@JoelSpeed
Copy link
Contributor

Do we have any idea of the use case for this? When would someone be deliberately using pointers here? Any scope of who we might break and how this might break them?

@alvaroaleman
Copy link
Member Author

Do we have any idea of the use case for this? When would someone be deliberately using pointers here? Any scope of who we might break and how this might break them?

I think its pretty uncommon and I think the main/only reason this might happen is when using gogo protobuf generation. It also didn't work at all until ~2 years ago: #2633

@JoelSpeed
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 28, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 45206b294cd752c37b711051e3f5ea377e2f9069

@k8s-ci-robot k8s-ci-robot merged commit 936b4aa into kubernetes-sigs:main May 28, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants