Merge pull request #7963 from henry118/gc-bug

use local variable for rt when iterating collectors
This commit is contained in:
Derek McGowan 2023-01-13 15:19:27 -08:00 committed by GitHub
commit 412ca496dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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