Skip to content

Commit a32f8f8

Browse files
committed
Removed mutex from fake k8s
1 parent 6070280 commit a32f8f8

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

pkg/common/unittestcommon/types.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ type FakeK8SOrchestrator struct {
5050
csiNodeTopologyInstances []interface{}
5151
// PVCs for testing
5252
pvcs []*v1.PersistentVolumeClaim
53-
// RWMutex to synchronize access to 'pvcs' field from multiple callers
54-
pvcsLock *sync.RWMutex
5553
}
5654

5755
// volumeMigration holds mocked migrated volume information

pkg/common/unittestcommon/utils.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,6 @@ func (c *FakeK8SOrchestrator) SetCSINodeTopologyInstances(instances []interface{
544544
}
545545

546546
func (c *FakeK8SOrchestrator) ListPVCs(ctx context.Context, namespace string) []*v1.PersistentVolumeClaim {
547-
if c.pvcsLock == nil {
548-
c.pvcsLock = &sync.RWMutex{}
549-
}
550-
c.pvcsLock.RLock()
551-
defer c.pvcsLock.RUnlock()
552-
553547
if namespace == "" {
554548
// Return all PVCs
555549
return c.pvcs
@@ -567,11 +561,6 @@ func (c *FakeK8SOrchestrator) ListPVCs(ctx context.Context, namespace string) []
567561

568562
// SetPVCs sets the PVCs for testing
569563
func (c *FakeK8SOrchestrator) SetPVCs(pvcs []*v1.PersistentVolumeClaim) {
570-
if c.pvcsLock == nil {
571-
c.pvcsLock = &sync.RWMutex{}
572-
}
573-
c.pvcsLock.Lock()
574-
defer c.pvcsLock.Unlock()
575564
c.pvcs = pvcs
576565
}
577566

0 commit comments

Comments
 (0)