From b9bd10c14e5e248d0dd8286f4d1e7895fd2523ed Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Fri, 13 Jan 2023 21:50:04 +0000 Subject: [PATCH] use local variable for rt when iterating collectors Signed-off-by: Henry Wang --- metadata/gc.go | 1 + 1 file changed, 1 insertion(+) diff --git a/metadata/gc.go b/metadata/gc.go index be0b693e4..aba72d56b 100644 --- a/metadata/gc.go +++ b/metadata/gc.go @@ -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