[PR #2093] [MERGED] Fix 764 #2490

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2093
Author: @mpoindexter
Created: 8/31/2024
Status: Merged
Merged: 9/3/2024
Merged by: @kradalby

Base: mainHead: fix-764


📝 Commits (6)

  • 830c9df Fix KeyExpiration when a zero time value has a timezone
  • 16e6c2e Fix whitespace
  • b1a712b Ensure that postgresql is used for all tests when env var is set
  • 645903d Pass through value of HEADSCALE_INTEGRATION_POSTGRES env var
  • d2009bc Add option to set timezone on headscale container
  • 63fb232 Add test for registration with auth key in alternate timezone

📊 Changes

8 files changed (+91 additions, -7 deletions)

View changed files

📝 .github/workflows/test-integration.yaml (+1 -0)
📝 CHANGELOG.md (+2 -0)
📝 hscontrol/mapper/tail.go (+2 -2)
📝 hscontrol/mapper/tail_test.go (+66 -0)
📝 integration/general_test.go (+9 -1)
📝 integration/hsic/hsic.go (+6 -0)
📝 integration/run.sh (+1 -0)
📝 integration/scenario.go (+4 -4)

📄 Description

When a zero time value is loaded from JSON or a DB in a way that assigns it the local timezone, it does not roudtrip in JSON as a value for which IsZero returns true. This causes KeyExpiry to be treated as a far past value instead of a nilish value.

See https://github.com/golang/go/issues/57040

  • have read the CONTRIBUTING.md file
  • 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

Fixes #764

Summary by CodeRabbit

  • New Features

    • Introduced new test cases to enhance testing for time-sensitive operations and PostgreSQL interactions.
    • Added a function to allow users to specify timezones for container configurations.
    • Enhanced test configurability with new options for flexible testing scenarios.
  • Bug Fixes

    • Resolved issues related to node registration in non-UTC timezones for PostgreSQL databases.
  • Documentation

    • Updated CHANGELOG to reflect recent updates and fixes.

🔄 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/2093 **Author:** [@mpoindexter](https://github.com/mpoindexter) **Created:** 8/31/2024 **Status:** ✅ Merged **Merged:** 9/3/2024 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `fix-764` --- ### 📝 Commits (6) - [`830c9df`](https://github.com/juanfont/headscale/commit/830c9df2a6e6365c95b8ca6a674488d71acb12bf) Fix KeyExpiration when a zero time value has a timezone - [`16e6c2e`](https://github.com/juanfont/headscale/commit/16e6c2e92509a5545791a3cb81d87b205a4b3ea5) Fix whitespace - [`b1a712b`](https://github.com/juanfont/headscale/commit/b1a712b155b5633d1af0cb2b3dbef639042087f8) Ensure that postgresql is used for all tests when env var is set - [`645903d`](https://github.com/juanfont/headscale/commit/645903d9d56dd432b311c22df60b7db6db11c2ca) Pass through value of HEADSCALE_INTEGRATION_POSTGRES env var - [`d2009bc`](https://github.com/juanfont/headscale/commit/d2009bc66e2162a98ed6a58a7b2f8935e173001e) Add option to set timezone on headscale container - [`63fb232`](https://github.com/juanfont/headscale/commit/63fb23231a38573121e454a39098478bcf585c2e) Add test for registration with auth key in alternate timezone ### 📊 Changes **8 files changed** (+91 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test-integration.yaml` (+1 -0) 📝 `CHANGELOG.md` (+2 -0) 📝 `hscontrol/mapper/tail.go` (+2 -2) 📝 `hscontrol/mapper/tail_test.go` (+66 -0) 📝 `integration/general_test.go` (+9 -1) 📝 `integration/hsic/hsic.go` (+6 -0) 📝 `integration/run.sh` (+1 -0) 📝 `integration/scenario.go` (+4 -4) </details> ### 📄 Description When a zero time value is loaded from JSON or a DB in a way that assigns it the local timezone, it does not roudtrip in JSON as a value for which IsZero returns true. This causes KeyExpiry to be treated as a far past value instead of a nilish value. See https://github.com/golang/go/issues/57040 <!-- Headscale is "Open Source, acknowledged contribution", this means that any contribution will have to be discussed with the Maintainers before being submitted. This model has been chosen to reduce the risk of burnout by limiting the maintenance overhead of reviewing and validating third-party code. Headscale is open to code contributions for bug fixes without discussion. If you find mistakes in the documentation, please submit a fix to the documentation. --> <!-- Please tick if the following things apply. You… --> - [x] have read the [CONTRIBUTING.md](./CONTRIBUTING.md) file - [ ] raised a GitHub issue or discussed it on the projects chat beforehand - [x] added unit tests - [ ] added integration tests - [ ] updated documentation if needed - [ ] updated CHANGELOG.md <!-- If applicable, please reference the issue using `Fixes #XXX` and add tests to cover your new code. --> Fixes #764 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new test cases to enhance testing for time-sensitive operations and PostgreSQL interactions. - Added a function to allow users to specify timezones for container configurations. - Enhanced test configurability with new options for flexible testing scenarios. - **Bug Fixes** - Resolved issues related to node registration in non-UTC timezones for PostgreSQL databases. - **Documentation** - Updated CHANGELOG to reflect recent updates and fixes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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 03:21:31 +01:00
adam closed this issue 2025-12-29 03:21:31 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2490