From e27e01c09fe396d4681aaf1b214d497cfa715ef2 Mon Sep 17 00:00:00 2001 From: Even Holthe Date: Wed, 11 Jan 2023 13:35:47 +0100 Subject: [PATCH] nodes list: expose expiration time --- cmd/headscale/cli/nodes.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/headscale/cli/nodes.go b/cmd/headscale/cli/nodes.go index 582c6123..35d0d284 100644 --- a/cmd/headscale/cli/nodes.go +++ b/cmd/headscale/cli/nodes.go @@ -475,6 +475,7 @@ func nodesToPtables( "IP addresses", "Ephemeral", "Last seen", + "Expiration", "Online", "Expired", } @@ -501,8 +502,12 @@ func nodesToPtables( } var expiry time.Time + var expiryTime string if machine.Expiry != nil { expiry = machine.Expiry.AsTime() + expiryTime = expiry.Format("2006-01-02 15:04:05") + } else { + expiryTime = "N/A" } var machineKey key.MachinePublic @@ -583,6 +588,7 @@ func nodesToPtables( strings.Join([]string{IPV4Address, IPV6Address}, ", "), strconv.FormatBool(ephemeral), lastSeenTime, + expiryTime, online, expired, }