mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-27 20:04:00 +01:00
Fixes a regression introduced in v0.27.0 where node expiry times were being reset to zero when tailscaled restarts and sends a MapRequest. The issue was caused by using GORM's Save() method in persistNodeToDB(), which overwrites ALL fields including zero values. When a MapRequest updates a node (without including expiry information), Save() would overwrite the database expiry field with a zero value. Changed to use Updates() which only updates non-zero values, preserving existing database values when struct pointer fields are nil. In BackfillNodeIPs, we need to explicitly update IPv4/IPv6 fields even when nil (to remove IPs), so we use Select() to specify those fields. Added regression test that validates expiry is preserved after MapRequest. Fixes #2862 |
||
|---|---|---|
| .. | ||
| sqliteconfig | ||
| testdata | ||
| api_key_test.go | ||
| api_key.go | ||
| db_test.go | ||
| db.go | ||
| ephemeral_garbage_collector_test.go | ||
| ip_test.go | ||
| ip.go | ||
| node_test.go | ||
| node.go | ||
| policy.go | ||
| preauth_keys_test.go | ||
| preauth_keys.go | ||
| schema.sql | ||
| suite_test.go | ||
| text_serialiser.go | ||
| users_test.go | ||
| users.go | ||