diff --git a/pkg/controllers/datastoresyncer/datastoresyncer_suite_test.go b/pkg/controllers/datastoresyncer/datastoresyncer_suite_test.go index 5cc45b38e2..8d86463612 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 a6fed07341..01ba36c7f3 100644 --- a/pkg/globalnet/controllers/controllers_suite_test.go +++ b/pkg/globalnet/controllers/controllers_suite_test.go @@ -46,12 +46,14 @@ 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" "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes/scheme" "k8s.io/klog" + mcsv1a1 "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" ) @@ -114,6 +116,10 @@ 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