DRA E2E: only check ResourceClaims in the test namespace

That was the original intent, but the implementation then ended up checking
ResourceClaims in all namespaces. Depending on timing this was merely
misleading (showing ResourceClaim changes from a different test running in
parallel), but with upcoming CRUD tests which intentionally set an allocation
result without a finalizer it breaks the non-CRUD tests when they check the
those CRUD ResourceClaims.
This commit is contained in:
Patrick Ohly
2025-08-29 09:12:14 +02:00
parent 2ac9ff1c1f
commit 545526cfe0

View File

@@ -149,7 +149,7 @@ func (nodes *Nodes) init(ctx context.Context, f *framework.Framework, minNodes,
claimInformer := cache.NewSharedIndexInformer(
&cache.ListWatch{
ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) {
slices, err := resourceClient.ResourceClaims("").List(ctx, options)
slices, err := resourceClient.ResourceClaims(f.Namespace.Name).List(ctx, options)
if err == nil {
resourceClaimLogger.Info("Listed ResourceClaims", "resourceAPI", resourceClient.CurrentAPI(), "numClaims", len(slices.Items), "listMeta", slices.ListMeta)
} else {
@@ -158,7 +158,7 @@ func (nodes *Nodes) init(ctx context.Context, f *framework.Framework, minNodes,
return slices, err
},
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
w, err := resourceClient.ResourceClaims("").Watch(ctx, options)
w, err := resourceClient.ResourceClaims(f.Namespace.Name).Watch(ctx, options)
if err == nil {
resourceClaimLogger.Info("Started watching ResourceClaims", "resourceAPI", resourceClient.CurrentAPI())
wrapper := newWatchWrapper(klog.LoggerWithName(resourceClaimLogger, fmt.Sprintf("%d", resourceClaimWatchCounter.Load())), w)