Skip to content

fix: update strfmt duration parsing#621

Open
bernot-dev wants to merge 1 commit into
kubernetes:masterfrom
bernot-dev:duration-backport
Open

fix: update strfmt duration parsing#621
bernot-dev wants to merge 1 commit into
kubernetes:masterfrom
bernot-dev:duration-backport

Conversation

@bernot-dev

Copy link
Copy Markdown

Update pkg/validation/strfmt/duration.go to backport the duration parsing improvements from upstream github.com/go-openapi/strfmt@v0.26.4.

Specifically, this makes validation more strict and performant. See: go-openapi/strfmt#246

Unrecognized tokens that do not correspond to a known duration will cause the format to be deemed invalid.

Update pkg/validation/strfmt/duration.go to backport the duration parsing improvements from upstream github.com/go-openapi/strfmt@v0.26.4.
@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 29, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bernot-dev
Once this PR has been reviewed and has the lgtm label, please assign liggitt for approval. For more information see the Code Review Process.

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

Details 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

@kubernetes-prow kubernetes-prow Bot requested review from apelisse and sttts June 29, 2026 22:34
@kubernetes-prow kubernetes-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 29, 2026
@Jefftree

Copy link
Copy Markdown
Member

LGTM

/cc @liggitt

Didn't get time to finish my previous attempt in #552, this should address the concerns you raised there. It backports go-openapi's parser, so the junk-skipping is gone. One note is that it still intentionally tolerates a space after the sign (- 5s), which I think should be fine?

@kubernetes-prow kubernetes-prow Bot requested a review from liggitt June 29, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants