mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
reload service registration configuration on SIGHUP (#17598)
* add reloading service configuration * add changelog entry * add tests * fix typo * check if config.ServiceRegistration is nil before signaling * add changes for deregistering service on nil config with failing tests * fix tests by decreasing reconcile_timeout + setting consul agent tokens * fix races * add comments in test --------- Co-authored-by: Marc Boudreau <marc.boudreau@hashicorp.com>
This commit is contained in:
@@ -1685,6 +1685,15 @@ func (c *ServerCommand) Run(args []string) int {
|
||||
}
|
||||
}
|
||||
|
||||
// notify ServiceRegistration that a configuration reload has occurred
|
||||
if sr := coreConfig.GetServiceRegistration(); sr != nil {
|
||||
var srConfig *map[string]string
|
||||
if config.ServiceRegistration != nil {
|
||||
srConfig = &config.ServiceRegistration.Config
|
||||
}
|
||||
sr.NotifyConfigurationReload(srConfig)
|
||||
}
|
||||
|
||||
if err := core.ReloadCensus(); err != nil {
|
||||
c.UI.Error(err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user