* Fix KeyExpiration when a zero time value has a timezone

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

* Fix whitespace

* Ensure that postgresql is used for all tests when env var is set

* Pass through value of HEADSCALE_INTEGRATION_POSTGRES env var

* Add option to set timezone on headscale container

* Add test for registration with auth key in alternate timezone
This commit is contained in:
Mike Poindexter 2024-09-03 00:22:17 -07:00 committed by GitHub
parent aa0f3d43cc
commit 3101f895a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 91 additions and 7 deletions

View file

@ -26,6 +26,7 @@ run_tests() {
--volume "$PWD:$PWD" -w "$PWD"/integration \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$PWD"/control_logs:/tmp/control \
-e "HEADSCALE_INTEGRATION_POSTGRES" \
golang:1 \
go test ./... \
-failfast \