Skip to content
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

Expected date-time format #1754

Closed
gauravrkulkarni opened this issue Jun 15, 2021 · 10 comments
Closed

Expected date-time format #1754

gauravrkulkarni opened this issue Jun 15, 2021 · 10 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@gauravrkulkarni
Copy link

gauravrkulkarni commented Jun 15, 2021

I have defined a custom resource with a status field "lastTransitionTime". I have defined it in date-time format. Relevant portion from CRD:

status:
  lastTransitionTime:
    type: string
    format: date-time

I used instructions here to generate models. Looks like lastTransitionTime gets converted into joda DateTime.
I have an operator that updates this field. When the operator tries to update the custom resource after setting this field, I see an error .lastTransitionTime in body must be of type date-time: \"

I looked at the client code, and looks like we are expected to use java OffsetDateTime. I tried to use OffsetDateTime, but it looks like the operator goes in constant reconciliation loop without any errors or exceptions (which doesn't happen if I don't update this field at all. I am able to update other fields in the status and they are not in date-time format).

  1. Is there a way to debug this further? Is there any other format that's expected?
  2. I am right now generating models using instructions here, which generates joda DateTime. Is there a way to create models that use OffsetDateTime instead (assuming that's the right format)? I have manually changed to OffsetDateTime for now.

Client Version: 12.0.0
Kubernetes Version: 1.19.11
Java Version:Java 8
Cloud: Azure (AKS)

Thanks in advance.

@brendandburns
Copy link
Contributor

We probably need to regenerate that docker image for building CRDs.

The change that introduced this for the main repo is here:

https://github.com/kubernetes-client/gen/pull/177/files

I think we need an updated pom.xml in that Dockerfile.

You could probably make that change manually yourself by building one more layer on top of the main generator Docker image.

cc @yue9944882

@yue9944882
Copy link
Member

We probably need to regenerate that docker image for building CRDs.

@brendandburns yes, i will re-gen an image adopting OffsetDateTime

When the operator tries to update the custom resource after setting this field, I see an error .lastTransitionTime in body must be of type date-time: "

@gauravrkulkarni i think the error is caused by server-side rejection, can you elaborate how you're serializing the datetime object? which codec are you currently using? or you can also pasted us the failing request body so that we can help you.

@karunasagark
Copy link

@yue9944882 checking to see if you have the re-gen the image with OffsetDateTime? If yes, can you please let me know where to find it?

@tony-clarke-amdocs
Copy link
Contributor

Yeah, I am hitting this too. It looks like PR 1418 was incomplete.

@yue9944882
Copy link
Member

i just bumped a new version of the crd model generator, plz let us know if it doesn't solve the issue.

docker.pkg.github.com/kubernetes-client/java/crd-model-gen:v1.0.4
ghcr.io/yue9944882/crd-model-gen:v1.0.4

@tony-clarke-amdocs
Copy link
Contributor

Thanks @yue9944882, that solved it!

@k8s-triage-robot
Copy link

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 29, 2021
@k8s-triage-robot
Copy link

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 29, 2021
@k8s-triage-robot
Copy link

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

7 participants