diff --git a/pkg/controllers/datastoresyncer/datastoresyncer_suite_test.go b/pkg/controllers/datastoresyncer/datastoresyncer_suite_test.go index 5cc45b38e..8d8646361 100644 --- a/pkg/controllers/datastoresyncer/datastoresyncer_suite_test.go +++ b/pkg/controllers/datastoresyncer/datastoresyncer_suite_test.go @@ -116,6 +116,7 @@ func newTestDriver() *testDriver { t.syncerScheme = runtime.NewScheme() Expect(submarinerv1.AddToScheme(t.syncerScheme)).To(Succeed()) + Expect(corev1.AddToScheme(t.syncerScheme)).To(Succeed()) t.localClient = fake.NewDynamicClient(t.syncerScheme) t.brokerClient = fake.NewDynamicClient(t.syncerScheme) diff --git a/pkg/globalnet/controllers/controllers_suite_test.go b/pkg/globalnet/controllers/controllers_suite_test.go index a6fed0734..6e26f3dcf 100644 --- a/pkg/globalnet/controllers/controllers_suite_test.go +++ b/pkg/globalnet/controllers/controllers_suite_test.go @@ -46,6 +46,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/apimachinery/pkg/util/wait" @@ -114,6 +115,11 @@ func newTestDriverBase() *testDriverBase { Expect(submarinerv1.AddToScheme(t.scheme)).To(Succeed()) Expect(corev1.AddToScheme(t.scheme)).To(Succeed()) + // TODO: Remove this workaround for https://github.com/kubernetes/client-go/issues/949 once + // admiral has been updated + t.scheme.AddKnownTypeWithName(schema.GroupVersionKind{Group: "fake-dynamic-client-group", Version: "v1", Kind: "List"}, + &unstructured.UnstructuredList{}) + fakeClient := fakeDynClient.NewDynamicClient(t.scheme) t.dynClient = fakeClient