From 67c7382d6720c238484d42fd37eb308ceecafe75 Mon Sep 17 00:00:00 2001 From: ying-zhu Date: Thu, 20 Oct 2022 18:20:14 -0700 Subject: [PATCH] capture --- pilot/pkg/model/push_context.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pilot/pkg/model/push_context.go b/pilot/pkg/model/push_context.go index 209e359bbc93..f9d55ae609e9 100644 --- a/pilot/pkg/model/push_context.go +++ b/pilot/pkg/model/push_context.go @@ -1678,9 +1678,10 @@ func (ps *PushContext) initSidecarScopes(env *Environment, wp *PushContextWorker go func() { for i := 0; i < n; i++ { + j := i work := func() { defer wg.Done() - c := sidecarConfigs[i] + c := sidecarConfigs[j] ch <- ConvertToSidecarScope(ps, &c, c.Namespace) } wp.PushWork(work)