From c22ab0530b133ccd25eeedce4c2d6dd8658584e1 Mon Sep 17 00:00:00 2001 From: "tao.yang" Date: Mon, 24 Jul 2023 14:44:56 +0800 Subject: [PATCH] fix: add multus crd to Scheme Signed-off-by: tao.yang --- framework/framework.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/framework/framework.go b/framework/framework.go index 1ed226bd..c3346ca4 100644 --- a/framework/framework.go +++ b/framework/framework.go @@ -19,6 +19,7 @@ import ( "os" "strconv" + nadv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" apiextensions_v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" @@ -185,6 +186,11 @@ func NewFramework(t TestingT, schemeRegisterList []func(*runtime.Scheme) error, } // f.Client, err = client.New(f.kConfig, client.Options{Scheme: scheme}) + err = nadv1.AddToScheme(scheme) + if err != nil { + return nil, fmt.Errorf("failed to add network_attachment_definition_v1 Scheme") + } + for n, v := range schemeRegisterList { if err := v(scheme); err != nil { return nil, fmt.Errorf("failed to add schemeRegisterList[%v], reason=%v ", n, err)