Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke FingerprintManager's Reload() func during agent's SIGHUP (Fixes #14614) #14615

Merged
merged 2 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/14615.txt
Original file line number Diff line number Diff line change
@@ -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
```
9 changes: 7 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,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

Expand Down Expand Up @@ -440,14 +443,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)
}

Expand Down Expand Up @@ -742,6 +745,8 @@ func (c *Client) Reload(newConfig *config.Config) error {
return c.reloadTLSConnections(newConfig.TLSConfig)
}

c.fingerprintManager.Reload()

return nil
}

Expand Down