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
V1Lease fails to serialize Date #828
Comments
This is related to this in the Java client code: Also discussion here: This probably requires changes us to insert a custom type for the v1Date objects instead of using javascript Date. |
@brendandburns |
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. |
Describe the bug
Attempting to create/update a Lease using the CoordinationV1Api fails due to the Date serializer calling toISOString(). Kubernetes expects this string to use the microsecond format (https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#leasespec-v1-coordination-k8s-io) - not the millisecond format that the Date object provides. (i.e. Date creates 2022-06-23T18:43:04.180Z but Kubernetes expects 2022-06-23T18:43:04.180000Z).
The response from the Kubernetes API is
As a workaround you can create a custom Date that overrides toISOString to convert to the correct format (see example code).
** Client Version **
0.16.3
** Server Version **
1.22.3
Expected behavior
Lease is created/updated
** Example Code**
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: