fix a memory leak problem when calling DryRunPreemption

This commit is contained in:
amewayne 2022-08-10 12:02:27 +08:00
parent a837be03ff
commit 1457ad548c

View File

@ -573,6 +573,7 @@ func (ev *Evaluator) DryRunPreemption(ctx context.Context, pod *v1.Pod, potentia
nonViolatingCandidates := newCandidateList(numCandidates)
violatingCandidates := newCandidateList(numCandidates)
parallelCtx, cancel := context.WithCancel(ctx)
defer cancel()
nodeStatuses := make(framework.NodeToStatusMap)
var statusesLock sync.Mutex
var errs []error