Skip to content

Commit 94e52a8

Browse files
committed
fix the test
Signed-off-by: Ryan Zhang <[email protected]>
1 parent dc57e28 commit 94e52a8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pkg/scheduler/scheduler_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,18 @@ func TestCleanUpAllBindingsForWithInterface(t *testing.T) {
409409
}
410410

411411
// Verify bindings were cleaned up
412-
bindingList := &fleetv1beta1.ClusterResourceBindingList{}
412+
var bindingList fleetv1beta1.BindingObjList
413+
if placement.GetNamespace() == "" {
414+
bindingList = &fleetv1beta1.ClusterResourceBindingList{}
415+
} else {
416+
bindingList = &fleetv1beta1.ResourceBindingList{}
417+
}
413418
if err := fakeClient.List(ctx, bindingList); err != nil {
414419
t.Fatalf("List() bindings = %v, want no error", err)
415420
}
416421

417-
if len(bindingList.Items) != 0 {
418-
t.Errorf("binding list length = %d, want 0", len(bindingList.Items))
422+
if len(bindingList.GetBindingObjs()) != 0 {
423+
t.Errorf("binding list length = %d, want 0", len(bindingList.GetBindingObjs()))
419424
}
420425
})
421426
}

0 commit comments

Comments
 (0)