Add a mutex to protect against simultaneous read/write to backend config

This addresses issues found by race detector.
This commit is contained in:
Archangel_SDY 2018-12-06 21:24:41 +08:00
parent 9122c08b3e
commit d58dbde5e3
3 changed files with 20 additions and 9 deletions

View file

@ -865,7 +865,8 @@ func newStore(t *testing.T) *k8sStore {
sslStore: NewSSLCertTracker(),
filesystem: fs,
updateCh: channels.NewRingChannel(10),
mu: new(sync.Mutex),
syncSecretMu: new(sync.Mutex),
backendConfigMu: new(sync.RWMutex),
secretIngressMap: NewObjectRefMap(),
pod: pod,
}