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
2946e42a9e
commit
6703787740
|
@ -345,8 +345,8 @@ func (a *TestAgent) Client() *api.Client {
|
|||
// DNSDisableCompression disables compression for all started DNS servers.
|
||||
func (a *TestAgent) DNSDisableCompression(b bool) {
|
||||
for _, srv := range a.dnsServers {
|
||||
cfg := srv.config.Load().(*dnsConfig)
|
||||
cfg.DisableCompression = b
|
||||
a.config.DNSDisableCompression = b
|
||||
srv.ReloadConfig(a.config)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue