-
Notifications
You must be signed in to change notification settings - Fork 544
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
Inconsistent deserialization behaviour when using KubernetesObjectApi.list
vs KubernetesObjectApi.get
#2018
Comments
KubernetesObjectApi.list
vs KubernetesObjectApi.get
KubernetesObjectApi.list
vs KubernetesObjectApi.get
I think that this is because we aren't passing type information down here: https://github.com/kubernetes-client/javascript/blob/master/src/object.ts#L478
If you want to investigate further, we'd be happy to take PRs to fix this. |
Hi @brendandburns I might try to tackle this in the coming days. In my project, I've fixed the issue by checking whether the package's list implementation returns deserialized objects or just plain objects. In the latter case I'm running the I think the problem is basically that the I have noticed that the implementation is aware of some list response types, e.g. there is V1PodList. My approach would be to define a generic list type, e.g. If I understand correctly, passing an explicit / generic That way I'm hoping to keep backwards compatibility for the known list types, and ensure unknown response types are treated consistently in the |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Describe the bug
The data returned by
KubernetesObjectApi.list()
does not deserialize timestamps in theitems[].metadata
field which makes the results inconsistent withKubernetesObjectApi.get()
. As a result, the returned manifests cannot directly be used with theKubernetesObjectApi.patch()
method because the string-based timestamps will be rejected.This issue might be related to the changes in #1695.
Client Version
0.22.1
Server Version
v1.30.5
Steps to Reproduce & Example Code
The following code snippet reproduces the problem. The code tries to list
VirtualServices
and thus requires istio to be installed. However, the problem can be reproduced with any other resource kind that is not known to the kubernetes/client-node package.Expected behavior
The above code should print the same line twice, e.g.:
However, when listing
VirtualServices
(or any other resource that isn't known to this package) the timestamp types in the metadata are different, e.g.:Environment:
Probably happens on any environment. For completeness, this is my test environment:
The text was updated successfully, but these errors were encountered: