Skip to content

Commit

Permalink
nodes list: expose expiration time
Browse files Browse the repository at this point in the history
  • Loading branch information
evenh authored and juanfont committed Jan 12, 2023
1 parent dd173ec commit e27e01c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/headscale/cli/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ func nodesToPtables(
"IP addresses",
"Ephemeral",
"Last seen",
"Expiration",
"Online",
"Expired",
}
Expand All @@ -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
Expand Down Expand Up @@ -583,6 +588,7 @@ func nodesToPtables(
strings.Join([]string{IPV4Address, IPV6Address}, ", "),
strconv.FormatBool(ephemeral),
lastSeenTime,
expiryTime,
online,
expired,
}
Expand Down

0 comments on commit e27e01c

Please sign in to comment.