mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 19:28:16 +00:00
Fix DATA RACE in unit tests: reconciler_test.go
This commit is contained in:
@@ -206,6 +206,12 @@ func (plugin *FakeVolumePlugin) NewAttacher() (Attacher, error) {
|
||||
return plugin.getFakeVolume(&plugin.Attachers), nil
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) GetAttachers() (Attachers []*FakeVolume) {
|
||||
plugin.RLock()
|
||||
defer plugin.RUnlock()
|
||||
return plugin.Attachers
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) GetNewAttacherCallCount() int {
|
||||
plugin.RLock()
|
||||
defer plugin.RUnlock()
|
||||
@@ -219,6 +225,12 @@ func (plugin *FakeVolumePlugin) NewDetacher() (Detacher, error) {
|
||||
return plugin.getFakeVolume(&plugin.Detachers), nil
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) GetDetachers() (Detachers []*FakeVolume) {
|
||||
plugin.RLock()
|
||||
defer plugin.RUnlock()
|
||||
return plugin.Detachers
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) GetNewDetacherCallCount() int {
|
||||
plugin.RLock()
|
||||
defer plugin.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user