From 1ff558d3d1954a79009404cef1a97960b4748752 Mon Sep 17 00:00:00 2001 From: Pinghao Wu Date: Wed, 22 May 2024 15:04:05 +0800 Subject: [PATCH] kcgid: gc: maxCount: fix namespace --- internal/cgid/kubernetes/gc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cgid/kubernetes/gc.go b/internal/cgid/kubernetes/gc.go index ad47343..ac86b63 100644 --- a/internal/cgid/kubernetes/gc.go +++ b/internal/cgid/kubernetes/gc.go @@ -163,7 +163,7 @@ func CollectGarbage(log logr.Logger, c client.WithWatch, apiset *kubecgiv1alpha1 go deleteUnlessLastN( log.WithValues("for", phase, "policy", "maxCount", "maxCount", n), c, n, - client.InNamespace(apiset.Name), + client.InNamespace(apiset.Namespace), client.MatchingLabels{managedByKey: manager}, client.MatchingLabels{generationKey: gen}, client.MatchingFields{"status.phase": string(phase)})