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

Backport of Replace all remaining time.ParseDurations with parseutil.ParseDurationSeconds into release/1.14.x #21362

Conversation

hc-github-team-secure-vault-core
Copy link
Collaborator

Backport

This PR is auto-generated from #21357 to be assessed for backporting due to the inclusion of the label backport/1.14.x.

The below text is copied from the body of the original PR.


Vault's duration string format supports a strict superset of options compared to Go's duration string format: https://developer.hashicorp.com/vault/docs/concepts/duration-format

In particular, we support days, e.g. 5d, whereas time.ParseDuration does not.

We use parseutil.ParseDurationSeconds everywhere in the code we can, to support our advertised duration format and to be consistent with ourselves. The majority of our code already uses parseutil.ParseDurationSeconds, but there were a few places I found that time.ParseDuration was still being used as part of poking around, so I thought I'd fix them all at once.

I'm not worried about the fact this change changes a lot of files. ParseDurationSeconds is battle-tested, and there's no valid duration that time.ParseDuration supports that we don't also support.


Overview of commits

@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/violethynes/change-all-parse-duration-to-parse-duration-seconds/informally-novel-giraffe branch from 13a649f to bfe6e2e Compare June 20, 2023 18:45
@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/violethynes/change-all-parse-duration-to-parse-duration-seconds/informally-novel-giraffe branch from 28db3fd to b0c5945 Compare June 20, 2023 18:45
@VioletHynes VioletHynes added this to the 1.14.1 milestone Jun 20, 2023
@VioletHynes VioletHynes self-requested a review June 20, 2023 19:13
@VioletHynes
Copy link
Contributor

Re-requesting my own review on this so GitHub will nag me every day until I hit approve it. I'll approve and merge when 1.14 is released and it's good to merge into the release branch, but I don't want to merge now as we're nearing the end of the release cycle.

…rse-duration-to-parse-duration-seconds/informally-novel-giraffe
@VioletHynes VioletHynes enabled auto-merge (squash) June 21, 2023 13:48
@VioletHynes VioletHynes merged commit 0f58c6f into release/1.14.x Jun 21, 2023
@VioletHynes VioletHynes deleted the backport/violethynes/change-all-parse-duration-to-parse-duration-seconds/informally-novel-giraffe branch June 21, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants