Open LFrobeen opened 2 weeks ago
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
requestPromise
takes an optional type
parameter, but we're not passing it.
If you want to investigate further, we'd be happy to take PRs to fix this.
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 https://github.com/kubernetes-client/javascript/pull/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: