[PR #598] [MERGED] Use Prometheus duration parser #1512

Closed
opened 2025-12-29 02:30:21 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/598
Author: @kradalby
Created: 5/30/2022
Status: Merged
Merged: 5/31/2022
Merged by: @kradalby

Base: mainHead: parse-duration-improv


📝 Commits (1)

  • d860270 Use Prometheus duration parser (support days and weeks)

📊 Changes

2 files changed (+36 additions, -10 deletions)

View changed files

📝 cmd/headscale/cli/api_key.go (+18 -5)
📝 cmd/headscale/cli/preauthkeys.go (+18 -5)

📄 Description

Use the duration parser from the Prometheus project, this allows us to use d, w and y.

This fixes #322

  • read the CONTRIBUTING guidelines
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/598 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 5/30/2022 **Status:** ✅ Merged **Merged:** 5/31/2022 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `parse-duration-improv` --- ### 📝 Commits (1) - [`d860270`](https://github.com/juanfont/headscale/commit/d860270733e5441b47d773c2d111b5d9d5b52f3f) Use Prometheus duration parser (support days and weeks) ### 📊 Changes **2 files changed** (+36 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `cmd/headscale/cli/api_key.go` (+18 -5) 📝 `cmd/headscale/cli/preauthkeys.go` (+18 -5) </details> ### 📄 Description Use the duration parser from the Prometheus project, this allows us to use `d`, `w` and `y`. This fixes #322 <!-- Please tick if the following things apply. You… --> - [x] read the [CONTRIBUTING guidelines](README.md#contributing) - [x] raised a GitHub issue or discussed it on the projects chat beforehand - [x] added unit tests - [x] added integration tests - [x] updated documentation if needed - [x] updated CHANGELOG.md <!-- If applicable, please reference the issue using `Fixes #XXX` and add tests to cover your new code. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:30:21 +01:00
adam closed this issue 2025-12-29 02:30:21 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1512