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

Tracking: Support human-readable duration format in CRDs #649

Closed
16 tasks done
sbernauer opened this issue Sep 14, 2023 · 0 comments · Fixed by #647
Closed
16 tasks done

Tracking: Support human-readable duration format in CRDs #649

sbernauer opened this issue Sep 14, 2023 · 0 comments · Fixed by #647
Assignees

Comments

@sbernauer
Copy link
Member

sbernauer commented Sep 14, 2023

I AS A USER want to not put in random big integer numbers in CRDs such as terminationgraceperiodseconds: 8763762374, but instead want to have some human readable duration such as terminationgraceperiod: 42h.

I AS A STACKABLE DEVELOPER want to not implement this in all operators, so have it in operator-rs

Requirements

  1. Must: Try to stick to the k8s way of specifying durations. It is ok to omit or add more features if this makes sense. In general its always easy to add new features, and hard to remove them again.
  2. Must: Having support for s,m,h,d,w
  3. Could: Having support for M,y as the implementation is more complicated but we might need this for ca certificate lifetime.
  4. Could: Millisecond support
  5. Must NOT: Support long variants 5seconds or 42minutes. K8s does not support this as well
  6. Should: You should be able to do all the stuff std::time::Duration supports

Implementation decisions

  • Custom struct Duration with inner type std::time::Duration
  • impl Deref for Duration with Target = std::time::Duration
  • operators should use the Duration struct everywhere in their code possible and prefer that over std::time::Duration so that, for example, log messages are consistent to the k8s way of formatting durations.

Implementation checklists

@Techassi Techassi reopened this Sep 18, 2023
@Techassi Techassi changed the title Support human-readable duration format in CRDs Tracking: Support human-readable duration format in CRDs Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants