mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Fix node e2e (kubelet metrics) by adding GinkgoRecover to a goroutine
to avoid panic
This commit is contained in:
parent
a0a0760027
commit
f37d8fd60f
@ -26,6 +26,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/util/wait"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
@ -67,8 +68,9 @@ func (c *PodClient) CreateBatch(pods []*api.Pod) []*api.Pod {
|
||||
for i, pod := range pods {
|
||||
wg.Add(1)
|
||||
go func(i int, pod *api.Pod) {
|
||||
defer wg.Done()
|
||||
defer GinkgoRecover()
|
||||
ps[i] = c.CreateSync(pod)
|
||||
wg.Done()
|
||||
}(i, pod)
|
||||
}
|
||||
wg.Wait()
|
||||
|
Loading…
Reference in New Issue
Block a user