Store WanAddress on Node
This commit is contained in:
parent
4f25443800
commit
369e501dd5
|
@ -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
|
||||
|
|
|
@ -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…
Reference in New Issue