test/e2e: explicitly use new err variable inside parallelized code

Signed-off-by: Maciej Szulik <soltysh@gmail.com>
This commit is contained in:
Maciej Szulik
2025-12-05 11:17:34 +01:00
parent 9293f9326d
commit 9eb57b6291

View File

@@ -252,7 +252,8 @@ var _ = SIGDescribe("Job", func() {
Namespace: pod.Namespace,
},
}
err = f.ClientSet.CoreV1().Pods(pod.Namespace).EvictV1(ctx, evictTarget)
// use new variable explicitly here, to ensure it doesn't escape the scope of goroutines
err := f.ClientSet.CoreV1().Pods(pod.Namespace).EvictV1(ctx, evictTarget)
framework.ExpectNoError(err, "failed to evict the pod: %s/%s", pod.Name, pod.Namespace)
ginkgo.By(fmt.Sprintf("Awaiting for the pod: %s/%s to be deleted", pod.Name, pod.Namespace))