diff --git a/Makefile b/Makefile index 86f99f83..7f3741d1 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ ENVTEST_ASSETS_DIR=$(shell pwd)/testbin test: manifests generate check ## Run tests. mkdir -p ${ENVTEST_ASSETS_DIR} test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.0/hack/setup-envtest.sh - source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out + source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./pkg/... -coverprofile cover.out ##@ e2e e2e: $(GOBIN)/ginkgo $(GOBIN)/kind helm diff --git a/tests/e2e/nebulacluster/nebulacluster.go b/tests/e2e/nebulacluster/nebulacluster.go index 4b2508bf..11403706 100644 --- a/tests/e2e/nebulacluster/nebulacluster.go +++ b/tests/e2e/nebulacluster/nebulacluster.go @@ -35,7 +35,6 @@ import ( e2eframework "github.com/vesoft-inc/nebula-operator/tests/e2e/framework" ) -// nolint: dupl var _ = ginkgo.Describe("NebulaCluster", func() { f := e2eframework.NewDefaultFramework("nebulacluster") diff --git a/tests/e2e/nebulacluster/util.go b/tests/e2e/nebulacluster/util.go index 3ef5751b..c6d53f76 100644 --- a/tests/e2e/nebulacluster/util.go +++ b/tests/e2e/nebulacluster/util.go @@ -31,7 +31,6 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" - "k8s.io/client-go/util/retry" "k8s.io/kubernetes/test/e2e/framework" "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" @@ -208,23 +207,6 @@ func waitForNebulaClusterDeleted( }) } -func updateNebulaCluster( - nc *v1alpha1.NebulaCluster, - runtimeClient client.Client, - updateFunc func() error, -) error { - key := client.ObjectKeyFromObject(nc) - return retry.RetryOnConflict(retry.DefaultRetry, func() error { - if err := runtimeClient.Get(context.TODO(), key, nc); err != nil { - return err - } - if err := updateFunc(); err != nil { - return err - } - return runtimeClient.Update(context.TODO(), nc) - }) -} - type nebulaLog struct{} func (l nebulaLog) Info(msg string) { framework.Logf(msg) } @@ -232,7 +214,6 @@ func (l nebulaLog) Warn(msg string) { framework.Logf(msg) } func (l nebulaLog) Error(msg string) { framework.Logf(msg) } func (l nebulaLog) Fatal(msg string) { framework.Logf(msg) } -// nolint: unparam func waitForExecuteNebulaSchema( timeout, pollInterval time.Duration, address string,