diff --git a/cmd/main.go b/cmd/main.go index d2ff598b..c16530c8 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -131,7 +131,7 @@ func runGrpcServer(grpcPort int, useKvm bool, store gokv.Store, spdkAddress, qmp ) s := grpc.NewServer(serverOptions...) - jsonRPC := spdk.NewSpdkJSONRPC(spdkAddress) + jsonRPC := spdk.NewClient(spdkAddress) backendServer := backend.NewServer(jsonRPC, store) middleendServer := middleend.NewServer(jsonRPC, store) diff --git a/go.mod b/go.mod index af7ef681..5485e50e 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1 github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 github.com/onsi/ginkgo/v2 v2.12.1 - github.com/opiproject/gospdk v0.0.0-20231003165248-8edbef6eb841 + github.com/opiproject/gospdk v0.0.0-20231009130851-ff9bd6faf71a github.com/opiproject/opi-api v0.0.0-20231005114927-ec55946e5197 github.com/philippgille/gokv v0.6.0 github.com/philippgille/gokv/gomap v0.6.0 diff --git a/go.sum b/go.sum index b6136446..d7fddcfe 100644 --- a/go.sum +++ b/go.sum @@ -431,6 +431,8 @@ github.com/opiproject/gospdk v0.0.0-20230924031820-4b65d0851cb9 h1:DkqXBfcVaJEts github.com/opiproject/gospdk v0.0.0-20230924031820-4b65d0851cb9/go.mod h1:rO2nM/OyY69zPLQO2mNX8+ckvyAd2TqV1vLLG7qEB74= github.com/opiproject/gospdk v0.0.0-20231003165248-8edbef6eb841 h1:xfR6qBHRRsRunE6+yDX5s1BhFFMElJNGh0MOt0rjLsU= github.com/opiproject/gospdk v0.0.0-20231003165248-8edbef6eb841/go.mod h1:mRMIpGIwz5uuUUaDhh6ceIYq20qR5OVtxE0/x5fprEA= +github.com/opiproject/gospdk v0.0.0-20231009130851-ff9bd6faf71a h1:8j6GXu13bFM3uEo30n1H3h1MmgncFhjQkqw0TWEEy00= +github.com/opiproject/gospdk v0.0.0-20231009130851-ff9bd6faf71a/go.mod h1:mRMIpGIwz5uuUUaDhh6ceIYq20qR5OVtxE0/x5fprEA= github.com/opiproject/opi-api v0.0.0-20231004104309-217649f4535f h1:TXLfuUmFwB7Zk8YKIzEfT/LQ2i5d+BW/BzjQgaBBOWM= github.com/opiproject/opi-api v0.0.0-20231004104309-217649f4535f/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= github.com/opiproject/opi-api v0.0.0-20231005114927-ec55946e5197 h1:3wsLOfvfaVcnhA3ehz4HkAoejop/rlLy0msWM2pA0zw= diff --git a/pkg/frontend/frontend_test.go b/pkg/frontend/frontend_test.go index 36f1e867..b9c9ac82 100644 --- a/pkg/frontend/frontend_test.go +++ b/pkg/frontend/frontend_test.go @@ -104,7 +104,7 @@ func dialer(opiSpdkServer *Server) func(context.Context, string) (net.Conn, erro } func TestFrontEnd_NewCustomizedServer(t *testing.T) { - validJSONRPC := spdk.NewSpdkJSONRPC("/some/path") + validJSONRPC := spdk.NewClient("/some/path") validNvmeTransports := map[pb.NvmeTransportType]NvmeTransport{ pb.NvmeTransportType_NVME_TRANSPORT_TCP: NewNvmeTCPTransport(), } diff --git a/pkg/utils/server.go b/pkg/utils/server.go index 93d44e4e..b0174263 100644 --- a/pkg/utils/server.go +++ b/pkg/utils/server.go @@ -66,12 +66,12 @@ func LimitPagination[T any](result []T, offset int, size int) ([]T, bool) { // CreateTestSpdkServer creates a mock spdk server for testing func CreateTestSpdkServer(socket string, spdkResponses []string) (net.Listener, spdk.JSONRPC) { - jsonRPC := spdk.NewSpdkJSONRPC(socket) + jsonRPC := spdk.NewClient(socket) ln := jsonRPC.StartUnixListener() if len(spdkResponses) > 0 { go spdkMockServerCommunicate(jsonRPC, ln, spdkResponses) } - return ln, jsonRPC.(*spdk.SpdkJSONRPC) + return ln, jsonRPC } // CloseGrpcConnection is utility function used to defer grpc connection close is tests