Merge pull request #111804 from amewayne/automated-cherry-pick-of-#111773-upstream-release-1.23

Automated cherry pick of #111773: fix a memory leak problem when calling DryRunPreemption
This commit is contained in:
Kubernetes Prow Robot 2022-08-12 06:02:43 -07:00 committed by GitHub
commit bebde23dab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -549,6 +549,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