mirror of
https://github.com/juanfont/headscale.git
synced 2026-04-09 18:53:48 +02:00
Fix node expiration success message
A node is expired when the requested expiration is either now or in the past.
This commit is contained in:
committed by
nblock
parent
ee127edbf7
commit
04b4071888
@@ -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)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user