From cc412d44f2f5dbb7f0ed6686feb0e331c6338bcd Mon Sep 17 00:00:00 2001 From: Mattia Eleuteri Date: Fri, 13 Nov 2026 13:07:08 +0100 Subject: [PATCH] test(controller): exercise the missing-root-LimitRange path under a compute-limit quota TestReconcile_PoolRootWithoutLimitRange declared its root quota on cpu, which the compute-limit gate does not count, so the sweep never looked for the root's LimitRange and the test passed whatever that path did. Declaring limits.cpu makes it reach the lookup, and it now fails if a missing root LimitRange produces an empty copy. Assisted-by: LLM Signed-off-by: Mattia Eleuteri --- internal/controller/tenantquota/reconciler_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controller/tenantquota/reconciler_test.go b/internal/controller/tenantquota/reconciler_test.go index 5c5778e63..b869825dc 100644 --- a/internal/controller/tenantquota/reconciler_test.go +++ b/internal/controller/tenantquota/reconciler_test.go @@ -351,12 +351,12 @@ func TestReconcile_PoolRootWithoutLimitRange(t *testing.T) { tenantHR("foo", "tenant-root"), tenantHR("bar", "tenant-foo"), ns("tenant-foo"), ns("tenant-foo-bar"), - chartQuota("tenant-foo", map[string]string{"cpu": "10"}, nil), + chartQuota("tenant-foo", map[string]string{"limits.cpu": "10"}, nil), ) if _, err := r.Reconcile(context.Background(), sweepKey); err != nil { t.Fatalf("reconcile: %v", err) } - if _, ok := allocatedHard(t, c, "tenant-foo-bar", "cpu"); !ok { + if _, ok := allocatedHard(t, c, "tenant-foo-bar", "limits.cpu"); !ok { t.Fatalf("tenant-foo-bar must still get its allocated quota") } if _, ok := getLimitRange(c, "tenant-foo-bar", allocatedLimitRangeName); ok {