-
Notifications
You must be signed in to change notification settings - Fork 530
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
KubernetesObjectApi does not properly return typed objects #852
Comments
I think that there are two different things here: The first is that the generic API ( I'm not sure I follow the issue with the Any improvements that you want to make in |
That was also my assumption, but I think It would b also beneficial if the generic api returned stringly typed objects for known types.
Too be clearer here.
Anyway I will create a PR and we can discuss the improvements there. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
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/test-infra repository. |
/reopen |
@schrodit: Reopened this issue. In response to this:
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. |
Describe the bug
When using the general
KubernetesObjectApi
the objects are not returned as typed objects as defined in the api definitions (https://github.com/kubernetes-client/javascript/tree/master/src/gen/api), but rather the plain json value is returned.** Client Version **
e.g.
0.16.3
** Server Version **
e.g.
1.21.0
To Reproduce
see code snippet
Expected behavior
I expect that known objects are returned with their proper types.
** Example Code**
Environment (please complete the following information):
Enhancement Proposal
I guess that the current behavior is intended to also support unknown objects.
Also one can currently work around the described issue by using the ObjectSerializer like that
But I think there could be a good opportunity to simplify the way the generic client can be used and improve the typing
Maybe something like that:
Further this example might be enhanced so that even custom types could be added to the known types that the ObjectSerializer can also serialize CRDs.
The text was updated successfully, but these errors were encountered: