From 04b4071888980f7944d231487790158553d2c9a1 Mon Sep 17 00:00:00 2001 From: Florian Preinstorfer Date: Sat, 24 Jan 2026 14:06:42 +0100 Subject: [PATCH] Fix node expiration success message A node is expired when the requested expiration is either now or in the past. --- cmd/headscale/cli/nodes.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/headscale/cli/nodes.go b/cmd/headscale/cli/nodes.go index 882460dd..fe5d9af5 100644 --- a/cmd/headscale/cli/nodes.go +++ b/cmd/headscale/cli/nodes.go @@ -276,7 +276,8 @@ var expireNodeCmd = &cobra.Command{ return } - expiryTime := time.Now() + now := time.Now() + expiryTime := now if expiry != "" { expiryTime, err = time.Parse(time.RFC3339, expiry) if err != nil { @@ -311,7 +312,11 @@ var expireNodeCmd = &cobra.Command{ ) } - SuccessOutput(response.GetNode(), "Node expired", output) + if now.Equal(expiryTime) || now.After(expiryTime) { + SuccessOutput(response.GetNode(), "Node expired", output) + } else { + SuccessOutput(response.GetNode(), "Node expiration updated", output) + } }, }