Skip to content

Set GVK in an object while calling typed-client #2946

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

HiranmoyChowdhury
Copy link

@HiranmoyChowdhury HiranmoyChowdhury commented Sep 16, 2024

Signed-off-by: Hiranmoy Das Chowdhury hiranmoy.das70@gmail.com

What type of PR is this?

/kind bug

What this PR does / why we need it:

While getting or creating or patching or updating object using typed-client which is a dynamic client in controller-runtime repository, gvk/TypeMeta found empty for that object because of the codec convention.
As unstructured client and metadata client and typed client is not exported. So, we can't call these from outside and we are using only one client for these. So, when we try to get unstructured object, we get the GVK. But, for structured object we missed GVK with the same client(from users perspective), this is a little confusion for newcomers like me. I had to find this by a lot of debugging. Also, there is an option to determine what the GVK is: obj.GetObjectKind().GroupVersionKind(). As there is a option I assumed this is fixed and set and we don't need to worry about this. I guess this should be set as expected.
To create owner reference or many more we won't need to pass scheme or gvk externally.

Does this PR introduce a user-facing change?

NONE

Which issue(s) this PR fixes:

kubernetes/kubernetes#80609
kubernetes/kubernetes#3030

Signed-off-by: Hiranmoy Das Chowdhury <hiranmoy.das70@gmail.com>
@k8s-ci-robot k8s-ci-robot requested a review from inteon September 16, 2024 14:05
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: HiranmoyChowdhury
Once this PR has been reviewed and has the lgtm label, please assign alvaroaleman for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 16, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @HiranmoyChowdhury. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions 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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 16, 2024
@troy0820
Copy link
Member

/hold

You have another PR that addresses this same issues with feedback from @alvaroaleman that is put on hold.

I believe the intent of the issue was said to be by design. @sbueringer thoughts?

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 16, 2024
@alvaroaleman
Copy link
Member

Lets please keep this discussion in one place at the first PR, #2943

@alvaroaleman
Copy link
Member

Closing, following #2943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants