diff --git a/api/nodes.go b/api/nodes.go index e1ef5e2aaa065882c4bafa52dcecbdb06cb1d4fd..194affde458667c56b25225433c225fc6efd7496 100644 --- a/api/nodes.go +++ b/api/nodes.go @@ -151,6 +151,7 @@ type HostDiskStats struct { // NodeListStub is a subset of information returned during // node list operations. type NodeListStub struct { + Address string ID string Datacenter string Name string diff --git a/command/node_status.go b/command/node_status.go index e14ea6fca9e7a2dd283800285748dd36423e0720..52dd7d15d4d8944ffe20aedc41283915773b1564 100644 --- a/command/node_status.go +++ b/command/node_status.go @@ -180,7 +180,7 @@ func (c *NodeStatusCommand) Run(args []string) int { out[0] = "ID|DC|Name|Class|" if c.verbose { - out[0] += "Version|" + out[0] += "Address|Version|" } out[0] += "Drain|Status" @@ -196,8 +196,8 @@ func (c *NodeStatusCommand) Run(args []string) int { node.Name, node.NodeClass) if c.verbose { - out[i+1] += fmt.Sprintf("|%s", - node.Version) + out[i+1] += fmt.Sprintf("|%s|%s", + node.Address, node.Version) } out[i+1] += fmt.Sprintf("|%v|%s", node.Drain, diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index fa994e194d143f595aad6120a0809546af47107e..a79f1071f0e0cb3000935c841b5cd2dce933a8ee 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -1172,6 +1172,7 @@ func (n *Node) TerminalStatus() bool { // Stub returns a summarized version of the node func (n *Node) Stub() *NodeListStub { return &NodeListStub{ + Address: n.Attributes["unique.network.ip-address"], ID: n.ID, Datacenter: n.Datacenter, Name: n.Name, @@ -1188,6 +1189,7 @@ func (n *Node) Stub() *NodeListStub { // NodeListStub is used to return a subset of job information // for the job list type NodeListStub struct { + Address string ID string Datacenter string Name string