use local variable for rt when iterating collectors

Signed-off-by: Henry Wang <henwang@amazon.com>
This commit is contained in:
Henry Wang 2023-01-13 21:50:04 +00:00
parent 60443133da
commit b9bd10c14e

View File

@ -141,6 +141,7 @@ func startGCContext(ctx context.Context, collectors map[gc.ResourceType]Collecto
if len(collectors) > 0 {
contexts = map[gc.ResourceType]CollectionContext{}
for rt, collector := range collectors {
rt := rt
c, err := collector.StartCollection(ctx)
if err != nil {
// Only skipping this resource this round