etcdctl: display HashRevision for 127.0.0.1:2379, 1084519789 command

Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
Benjamin Wang 2022-11-21 08:38:50 +08:00
parent 590911dfe3
commit 48b8210044
2 changed files with 3 additions and 1 deletions

View File

@ -233,11 +233,12 @@ func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]stri
}
func makeEndpointHashKVTable(hashList []epHashKV) (hdr []string, rows [][]string) {
hdr = []string{"endpoint", "hash"}
hdr = []string{"endpoint", "hash", "revision"}
for _, h := range hashList {
rows = append(rows, []string{
h.Ep,
fmt.Sprint(h.Resp.Hash),
fmt.Sprint(h.Resp.HashRevision),
})
}
return hdr, rows

View File

@ -212,6 +212,7 @@ func (p *fieldsPrinter) EndpointHashKV(hs []epHashKV) {
p.hdr(h.Resp.Header)
fmt.Printf("\"Endpoint\" : %q\n", h.Ep)
fmt.Println(`"Hash" :`, h.Resp.Hash)
fmt.Println(`"HashRevision" :`, h.Resp.HashRevision)
fmt.Println()
}
}