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:
parent
ee127edbf7
commit
04b4071888
1 changed files with 7 additions and 2 deletions
|
|
@ -276,7 +276,8 @@ var expireNodeCmd = &cobra.Command{
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
expiryTime := time.Now()
|
now := time.Now()
|
||||||
|
expiryTime := now
|
||||||
if expiry != "" {
|
if expiry != "" {
|
||||||
expiryTime, err = time.Parse(time.RFC3339, expiry)
|
expiryTime, err = time.Parse(time.RFC3339, expiry)
|
||||||
if err != nil {
|
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)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue