Skip to content

Commit

Permalink
Fix failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
luksa authored and maistra-bot committed Sep 20, 2022
1 parent a37540b commit f0b868f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/informers/dynamic_test.go
Expand Up @@ -203,16 +203,15 @@ func TestDynamicSharedInformerFactory(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
scheme := runtime.NewScheme()
err := extensionsv1beta1.AddToScheme(scheme)
if err != nil {
t.Fatalf("couldn't add appsv1 to scheme: %v", err)
}
informerReceiveObjectCh := make(chan *unstructured.Unstructured, 1)
objs := []runtime.Object{}
if ts.existingObj != nil {
objs = append(objs, ts.existingObj)
}
fakeClient := fake.NewSimpleDynamicClient(scheme, objs...)
gvrToListKind := map[schema.GroupVersionResource]string{
extensionsv1beta1.SchemeGroupVersion.WithResource("deployments"): "DeploymentList",
}
fakeClient := fake.NewSimpleDynamicClientWithCustomListKinds(scheme, gvrToListKind, objs...)
target := xnsinformers.NewDynamicSharedInformerFactory(fakeClient, 0)
target.SetNamespaces(ns)

Expand Down

0 comments on commit f0b868f

Please sign in to comment.