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:
Florian Preinstorfer
2026-01-24 14:06:42 +01:00
committed by nblock
parent ee127edbf7
commit 04b4071888

View File

@@ -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)
}
},
}