mirror of https://github.com/status-im/consul.git
agent: fix a data race in DNS tests
The dnsConfig pulled from the atomic.Value is a pointer, so modifying it in place creates a data race. Use the exported ReloadConfig interface instead.
This commit is contained in:
parent
970f5d78ec
commit
0acfc2c65b
|
@ -345,8 +345,8 @@ func (a *TestAgent) Client() *api.Client {
|
||||||
// DNSDisableCompression disables compression for all started DNS servers.
|
// DNSDisableCompression disables compression for all started DNS servers.
|
||||||
func (a *TestAgent) DNSDisableCompression(b bool) {
|
func (a *TestAgent) DNSDisableCompression(b bool) {
|
||||||
for _, srv := range a.dnsServers {
|
for _, srv := range a.dnsServers {
|
||||||
cfg := srv.config.Load().(*dnsConfig)
|
a.config.DNSDisableCompression = b
|
||||||
cfg.DisableCompression = b
|
srv.ReloadConfig(a.config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue