Browse Source

Store WanAddress on Node

pull/1698/head
Evan Gilman 9 years ago committed by James Phillips
parent
commit
90aafbbdb6
  1. 7
      consul/state/state_store.go
  2. 15
      consul/structs/structs.go

7
consul/state/state_store.go

@ -474,7 +474,7 @@ func (s *StateStore) EnsureRegistration(idx uint64, req *structs.RegisterRequest
func (s *StateStore) ensureRegistrationTxn(tx *memdb.Txn, idx uint64, watches *DumbWatchManager,
req *structs.RegisterRequest) error {
// Add the node.
node := &structs.Node{Node: req.Node, Address: req.Address}
node := &structs.Node{Node: req.Node, Address: req.Address, WanAddress: req.WanAddress}
if err := s.ensureNodeTxn(tx, idx, watches, node); err != nil {
return fmt.Errorf("failed inserting node: %s", err)
}
@ -1373,8 +1373,9 @@ func (s *StateStore) parseNodes(tx *memdb.Txn, idx uint64,
// Create the wrapped node
dump := &structs.NodeInfo{
Node: node.Node,
Address: node.Address,
Node: node.Node,
Address: node.Address,
WanAddress: node.WanAddress,
}
// Query the node services

15
consul/structs/structs.go

@ -162,6 +162,7 @@ type RegisterRequest struct {
Datacenter string
Node string
Address string
WanAddress string
Service *NodeService
Check *HealthCheck
Checks HealthChecks
@ -245,8 +246,9 @@ func (r *ChecksInStateRequest) RequestDatacenter() string {
// Used to return information about a node
type Node struct {
Node string
Address string
Node string
Address string
WanAddress string
RaftIndex
}
@ -438,10 +440,11 @@ OUTER:
// a node. This is currently used for the UI only, as it is
// rather expensive to generate.
type NodeInfo struct {
Node string
Address string
Services []*NodeService
Checks []*HealthCheck
Node string
Address string
WanAddress string
Services []*NodeService
Checks []*HealthCheck
}
// NodeDump is used to dump all the nodes with all their

Loading…
Cancel
Save