mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Invoke FingerprintManager's Reload() func during agent's SIGHUP (#14615)
Fixes #14614
This commit is contained in:
committed by
GitHub
parent
2b9158b73e
commit
536260c7bb
3
.changelog/14615.txt
Normal file
3
.changelog/14615.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
client: Fixed a bug where network fingerprinters were not reloaded when the client configuration was reloaded with SIGHUP
|
||||
```
|
||||
@@ -298,6 +298,9 @@ type Client struct {
|
||||
endpoints rpcEndpoints
|
||||
streamingRpcs *structs.StreamingRpcRegistry
|
||||
|
||||
// fingerprintManager is the FingerprintManager registered by the client
|
||||
fingerprintManager *FingerprintManager
|
||||
|
||||
// pluginManagers is the set of PluginManagers registered by the client
|
||||
pluginManagers *pluginmanager.PluginGroup
|
||||
|
||||
@@ -441,14 +444,14 @@ func NewClient(cfg *config.Config, consulCatalog consul.CatalogAPI, consulProxie
|
||||
return nil, fmt.Errorf("node setup failed: %v", err)
|
||||
}
|
||||
|
||||
fingerprintManager := NewFingerprintManager(
|
||||
c.fingerprintManager = NewFingerprintManager(
|
||||
cfg.PluginSingletonLoader, c.GetConfig, cfg.Node,
|
||||
c.shutdownCh, c.updateNodeFromFingerprint, c.logger)
|
||||
|
||||
c.pluginManagers = pluginmanager.New(c.logger)
|
||||
|
||||
// Fingerprint the node and scan for drivers
|
||||
if err := fingerprintManager.Run(); err != nil {
|
||||
if err := c.fingerprintManager.Run(); err != nil {
|
||||
return nil, fmt.Errorf("fingerprinting failed: %v", err)
|
||||
}
|
||||
|
||||
@@ -743,6 +746,8 @@ func (c *Client) Reload(newConfig *config.Config) error {
|
||||
return c.reloadTLSConnections(newConfig.TLSConfig)
|
||||
}
|
||||
|
||||
c.fingerprintManager.Reload()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user