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

Add utility functions to parse and format GEP-2257 Duration strings for Gateway API #2261

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

kflynn
Copy link
Contributor

@kflynn kflynn commented Aug 10, 2024

Signed-off-by: Flynn emissary@flynn.kodachi.com

/kind feature

This PR adds utility functions to parse and format GEP-2257 Durations for Gateway API, as well as unit tests for them. As Gateway API becomes more common, it's nice to be able to work with its resources in all the languages that people use for wrangling Kubernetes.

Add utility functions kubernetes.utils.duration.parse_duration and kubernetes.utils.duration.format_duration to manage Gateway API Duration strings as specified by GEP-2257.
- [GEP] https://gateway-api.sigs.k8s.io/geps/gep-2257/

…or Gateway API

Signed-off-by: Flynn <emissary@flynn.kodachi.com>
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 10, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @kflynn!

It looks like this is your first PR to kubernetes-client/python 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-client/python has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 10, 2024
@yliaog yliaog self-assigned this Aug 12, 2024
@yliaog
Copy link
Contributor

yliaog commented Aug 12, 2024

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 12, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kflynn, yliaog

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2024
@k8s-ci-robot k8s-ci-robot merged commit 90d4fef into kubernetes-client:master Aug 12, 2024
10 checks passed
@kflynn kflynn deleted the flynn/dev/gep-2257 branch August 16, 2024 19:30
@hswong3i
Copy link

hswong3i commented Nov 4, 2024

To downstream OS packager:

This PR newly add a dependency with durationpy>=0.7 (see #2261), which you may not find in any standard Linux distro (see https://pkgs.org/search/?q=durationpy).

Don't forget also package your python3-durationpy as my OBS repo (see https://build.opensuse.org/package/show/home:alvistack/icholy-durationpy-0.9), else you may face runtime error as me, too ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants