From d80e73c0a9f2f617aa2364810cd081395c2fcc02 Mon Sep 17 00:00:00 2001 From: Dev1622 Date: Wed, 26 Nov 2025 19:56:42 +0530 Subject: [PATCH] cleanup: removed uncached client plumbing, keeping the sequencing fix for quota validation --- test/e2e/storage/csimock/csi_volume_expansion.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/e2e/storage/csimock/csi_volume_expansion.go b/test/e2e/storage/csimock/csi_volume_expansion.go index de2061a55f5..e8683b203f6 100644 --- a/test/e2e/storage/csimock/csi_volume_expansion.go +++ b/test/e2e/storage/csimock/csi_volume_expansion.go @@ -21,8 +21,6 @@ import ( "fmt" "time" - corev1client "k8s.io/client-go/kubernetes/typed/core/v1" - csipbv1 "github.com/container-storage-interface/spec/lib/go/csi" "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" @@ -584,16 +582,14 @@ var _ = utils.SIGDescribe("CSI Mock volume expansion", func() { } if test.expectedQuotaUsage != nil { - // Use uncached client to avoid watch/cache lag when validating quota usage - uncachedClient := f.ClientSet.CoreV1() - validateQuotaUsage(ctx, m, currentQuota, test.expectedQuotaUsage, uncachedClient) + validateQuotaUsage(ctx, m, currentQuota, test.expectedQuotaUsage) } }) } }) }) -func validateQuotaUsage(ctx context.Context, m *mockDriverSetup, currentQuota, expectedQuota *v1.ResourceQuota, uncachedClient corev1client.CoreV1Interface) { +func validateQuotaUsage(ctx context.Context, m *mockDriverSetup, currentQuota, expectedQuota *v1.ResourceQuota) { ginkgo.By("Waiting for resource quota usage to be updated") var ( quota *v1.ResourceQuota @@ -605,7 +601,7 @@ func validateQuotaUsage(ctx context.Context, m *mockDriverSetup, currentQuota, e expectedUsedSize := expectedQuota.Status.Used[pvcSizeQuotaKey] gomega.Eventually(func() error { - q, err := uncachedClient.ResourceQuotas(currentQuota.Namespace).Get(ctx, currentQuota.Name, metav1.GetOptions{}) + q, err := m.cs.CoreV1().ResourceQuotas(currentQuota.Namespace).Get(ctx, currentQuota.Name, metav1.GetOptions{}) if err != nil { return fmt.Errorf("failed to get resource quota %s/%s: %w", currentQuota.Namespace, currentQuota.Name, err) }