mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Client config param added to specify net iface to use for fingerprinting. Added a Golang-native method for determining the interface IP address.
This commit is contained in:
@@ -192,6 +192,9 @@ func (a *Agent) setupClient() error {
|
||||
conf.AllocDir = a.config.Client.AllocDir
|
||||
}
|
||||
conf.Servers = a.config.Client.Servers
|
||||
if a.config.Client.Iface != "" {
|
||||
conf.Iface = a.config.Client.Iface
|
||||
}
|
||||
|
||||
// Setup the node
|
||||
conf.Node = new(structs.Node)
|
||||
|
||||
@@ -139,6 +139,9 @@ type ClientConfig struct {
|
||||
|
||||
// Metadata associated with the node
|
||||
Meta map[string]string `hcl:"meta"`
|
||||
|
||||
// Interface to use for network fingerprinting
|
||||
Iface string `hcl:"iface"`
|
||||
}
|
||||
|
||||
// ServerConfig is configuration specific to the server mode
|
||||
@@ -384,6 +387,9 @@ func (a *ClientConfig) Merge(b *ClientConfig) *ClientConfig {
|
||||
if b.NodeClass != "" {
|
||||
result.NodeClass = b.NodeClass
|
||||
}
|
||||
if b.Iface != "" {
|
||||
result.Iface = b.Iface
|
||||
}
|
||||
|
||||
// Add the servers
|
||||
result.Servers = append(result.Servers, b.Servers...)
|
||||
|
||||
Reference in New Issue
Block a user