diff --git a/etcdctl/ctlv3/command/ep_command.go b/etcdctl/ctlv3/command/ep_command.go index 27ac820d4..742f07aae 100644 --- a/etcdctl/ctlv3/command/ep_command.go +++ b/etcdctl/ctlv3/command/ep_command.go @@ -104,8 +104,8 @@ func epHealthCommandFunc(cmd *cobra.Command, args []string) { } type epStatus struct { - ep string - resp *v3.StatusResponse + Ep string `json:"Endpoint"` + Resp *v3.StatusResponse `json:"Status"` } func epStatusCommandFunc(cmd *cobra.Command, args []string) { @@ -122,7 +122,7 @@ func epStatusCommandFunc(cmd *cobra.Command, args []string) { fmt.Fprintf(os.Stderr, "Failed to get the status of endpoint %s (%v)\n", ep, serr) continue } - statusList = append(statusList, epStatus{ep: ep, resp: resp}) + statusList = append(statusList, epStatus{Ep: ep, Resp: resp}) } display.EndpointStatus(statusList) diff --git a/etcdctl/ctlv3/command/printer.go b/etcdctl/ctlv3/command/printer.go index dd9dbf8f4..a5b323192 100644 --- a/etcdctl/ctlv3/command/printer.go +++ b/etcdctl/ctlv3/command/printer.go @@ -134,13 +134,13 @@ func (s *simplePrinter) EndpointStatus(statusList []epStatus) { for _, status := range statusList { table.Append([]string{ - fmt.Sprint(status.ep), - fmt.Sprintf("%x", status.resp.Header.MemberId), - fmt.Sprint(status.resp.Version), - fmt.Sprint(humanize.Bytes(uint64(status.resp.DbSize))), - fmt.Sprint(status.resp.Leader == status.resp.Header.MemberId), - fmt.Sprint(status.resp.RaftTerm), - fmt.Sprint(status.resp.RaftIndex), + fmt.Sprint(status.Ep), + fmt.Sprintf("%x", status.Resp.Header.MemberId), + fmt.Sprint(status.Resp.Version), + fmt.Sprint(humanize.Bytes(uint64(status.Resp.DbSize))), + fmt.Sprint(status.Resp.Leader == status.Resp.Header.MemberId), + fmt.Sprint(status.Resp.RaftTerm), + fmt.Sprint(status.Resp.RaftIndex), }) }