From f899976b41b12d83759ef166f0c6b8e167b563f0 Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Wed, 24 Jun 2020 14:14:03 +0800 Subject: [PATCH] fixup --- .../framework/plugins/volumebinding/volume_binding.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go b/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go index b63056ad159..8b001def107 100644 --- a/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go +++ b/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go @@ -20,7 +20,6 @@ import ( "context" "errors" "fmt" - "sync" "time" v1 "k8s.io/api/core/v1" @@ -50,9 +49,6 @@ type stateData struct { // phase for each node // it's initialized in the PreFilter phase podVolumesByNode map[string]*scheduling.PodVolumes - // guards podVolumesByNode in the Filter phase, as the method may be called - // in parallel - podVolumesByNodeMutex sync.Mutex } func (d *stateData) Clone() framework.StateData { @@ -172,9 +168,9 @@ func (pl *VolumeBinding) Filter(ctx context.Context, cs *framework.CycleState, p return status } - state.podVolumesByNodeMutex.Lock() + cs.Lock() state.podVolumesByNode[node.Name] = podVolumes - state.podVolumesByNodeMutex.Unlock() + cs.Unlock() return nil }