mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl/ctlv3: clarify "lease timetolive" output on expired lease
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
828289db32
commit
9978b4fd35
@ -93,6 +93,11 @@ func (p *simplePrinter) KeepAlive(resp v3.LeaseKeepAliveResponse) {
|
||||
}
|
||||
|
||||
func (s *simplePrinter) TimeToLive(resp v3.LeaseTimeToLiveResponse, keys bool) {
|
||||
if resp.GrantedTTL == 0 && resp.TTL == -1 {
|
||||
fmt.Printf("lease %016x already expired\n", resp.ID)
|
||||
return
|
||||
}
|
||||
|
||||
txt := fmt.Sprintf("lease %016x granted with TTL(%ds), remaining(%ds)", resp.ID, resp.GrantedTTL, resp.TTL)
|
||||
if keys {
|
||||
ks := make([]string, len(resp.Keys))
|
||||
|
Loading…
x
Reference in New Issue
Block a user