Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update opi-api digest and api changes #874

Merged
merged 6 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries.
// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries.
// Copyright (C) 2023 Intel Corporation
package main

Expand Down Expand Up @@ -147,8 +147,8 @@ func runGrpcServer(grpcPort int, useKvm bool, store gokv.Store, spdkAddress, qmp
frontendServer := frontend.NewCustomizedServer(jsonRPC,
store,
map[pb.NvmeTransportType]frontend.NvmeTransport{
pb.NvmeTransportType_NVME_TRANSPORT_TCP: frontend.NewNvmeTCPTransport(jsonRPC),
pb.NvmeTransportType_NVME_TRANSPORT_PCIE: kvm.NewNvmeVfiouserTransport(ctrlrDir, jsonRPC),
pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP: frontend.NewNvmeTCPTransport(jsonRPC),
pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE: kvm.NewNvmeVfiouserTransport(ctrlrDir, jsonRPC),
},
frontend.NewVhostUserBlkTransport(),
)
Expand All @@ -161,7 +161,7 @@ func runGrpcServer(grpcPort int, useKvm bool, store gokv.Store, spdkAddress, qmp
frontendServer := frontend.NewCustomizedServer(jsonRPC,
store,
map[pb.NvmeTransportType]frontend.NvmeTransport{
pb.NvmeTransportType_NVME_TRANSPORT_TCP: frontend.NewNvmeTCPTransport(jsonRPC),
pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP: frontend.NewNvmeTCPTransport(jsonRPC),
},
frontend.NewVhostUserBlkTransport(),
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0
github.com/onsi/ginkgo/v2 v2.14.0
github.com/opiproject/gospdk v0.0.0-20240108075015-92d689fff706
github.com/opiproject/opi-api v0.0.0-20231211154947-aee3998dd0c2
github.com/opiproject/opi-api v0.0.0-20240118183513-e44db269fba4
github.com/philippgille/gokv v0.6.0
github.com/philippgille/gokv/gomap v0.6.0
github.com/philippgille/gokv/redis v0.6.0
Expand Down
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pO
github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE=
github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw=
github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY=
github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU=
github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s=
github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down Expand Up @@ -451,8 +453,8 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/opiproject/gospdk v0.0.0-20240108075015-92d689fff706 h1:fZcUuXgfsfWIbSZTPCJG72wh7LyKIyrpPR9kH+rKEXI=
github.com/opiproject/gospdk v0.0.0-20240108075015-92d689fff706/go.mod h1:9CMbTd9ptR6tl6HRRn8C33DPeWF85hTo4KZCa5iKftY=
github.com/opiproject/opi-api v0.0.0-20231211154947-aee3998dd0c2 h1:sWvDPuYS6Kbke3k5rpD46kHhGx//rBKMw3Z1/mDZxdk=
github.com/opiproject/opi-api v0.0.0-20231211154947-aee3998dd0c2/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY=
github.com/opiproject/opi-api v0.0.0-20240118183513-e44db269fba4 h1:YBjvYWQQAbNIGsAXvB6FwL9Encr1nzo3/w+bB/tXltM=
github.com/opiproject/opi-api v0.0.0-20240118183513-e44db269fba4/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY=
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
github.com/otiai10/copy v1.11.0 h1:OKBD80J/mLBrwnzXqGtFCzprFSGioo30JcmR4APsNwc=
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
Expand Down Expand Up @@ -513,6 +515,7 @@ github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0=
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs=
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
Expand Down
23 changes: 12 additions & 11 deletions pkg/backend/aio_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries.
// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries.
// Copyright (C) 2023 Intel Corporation

// Package backend implememnts the BackEnd APIs (network facing) of the storage Server
Expand Down Expand Up @@ -479,15 +479,16 @@ func TestBackEnd_ListAioVolumes(t *testing.T) {
size: 1,
token: "existing-pagination-token",
},
"no required field": {
in: "",
out: []*pb.AioVolume{},
spdk: []string{},
errCode: codes.Unknown,
errMsg: "missing required field: parent",
size: 0,
token: "",
},
// Parent field not in message - depricate test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can just remove this test since there is no parent anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great - I deprecated it to start with but will remove it completely.

// "no required field": {
// in: "",
// out: []*pb.AioVolume{},
// spdk: []string{},
// errCode: codes.Unknown,
// errMsg: "missing required field: parent",
// size: 0,
// token: "",
// },
}

// run tests
Expand All @@ -498,7 +499,7 @@ func TestBackEnd_ListAioVolumes(t *testing.T) {

testEnv.opiSpdkServer.Pagination["existing-pagination-token"] = 1

request := &pb.ListAioVolumesRequest{Parent: tt.in, PageSize: tt.size, PageToken: tt.token}
request := &pb.ListAioVolumesRequest{PageSize: tt.size, PageToken: tt.token}
response, err := testEnv.client.ListAioVolumes(testEnv.ctx, request)

if !utils.EqualProtoSlices(response.GetAioVolumes(), tt.out) {
Expand Down
7 changes: 3 additions & 4 deletions pkg/backend/null.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries.
// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries.
// Copyright (C) 2023 Intel Corporation

// Package backend implememnts the BackEnd APIs (network facing) of the storage Server
Expand All @@ -13,7 +13,6 @@ import (
"sort"

"github.com/opiproject/gospdk/spdk"
pc "github.com/opiproject/opi-api/common/v1/gen/go"
pb "github.com/opiproject/opi-api/storage/v1alpha1/gen/go"
"github.com/opiproject/opi-spdk-bridge/pkg/utils"

Expand Down Expand Up @@ -203,7 +202,7 @@ func (s *Server) ListNullVolumes(ctx context.Context, in *pb.ListNullVolumesRequ
Blobarray := make([]*pb.NullVolume, len(result))
for i := range result {
r := &result[i]
Blobarray[i] = &pb.NullVolume{Name: r.Name, Uuid: &pc.Uuid{Value: r.UUID}, BlockSize: r.BlockSize, BlocksCount: r.NumBlocks}
Blobarray[i] = &pb.NullVolume{Name: r.Name, Uuid: r.UUID, BlockSize: r.BlockSize, BlocksCount: r.NumBlocks}
}
sortNullVolumes(Blobarray)
return &pb.ListNullVolumesResponse{NullVolumes: Blobarray, NextPageToken: token}, nil
Expand Down Expand Up @@ -235,7 +234,7 @@ func (s *Server) GetNullVolume(ctx context.Context, in *pb.GetNullVolumeRequest)
msg := fmt.Sprintf("expecting exactly 1 result, got %d", len(result))
return nil, status.Errorf(codes.InvalidArgument, msg)
}
return &pb.NullVolume{Name: result[0].Name, Uuid: &pc.Uuid{Value: result[0].UUID}, BlockSize: result[0].BlockSize, BlocksCount: result[0].NumBlocks}, nil
return &pb.NullVolume{Name: result[0].Name, Uuid: result[0].UUID, BlockSize: result[0].BlockSize, BlocksCount: result[0].NumBlocks}, nil
}

// StatsNullVolume gets a Null volume instance stats
Expand Down
19 changes: 9 additions & 10 deletions pkg/backend/null_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries.
// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries.
// Copyright (C) 2023 Intel Corporation

// Package backend implememnts the BackEnd APIs (network facing) of the storage Server
Expand All @@ -17,7 +17,6 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

pc "github.com/opiproject/opi-api/common/v1/gen/go"
pb "github.com/opiproject/opi-api/storage/v1alpha1/gen/go"
"github.com/opiproject/opi-spdk-bridge/pkg/utils"
)
Expand Down Expand Up @@ -393,13 +392,13 @@ func TestBackEnd_ListNullVolumes(t *testing.T) {
out: []*pb.NullVolume{
{
Name: "Malloc0",
Uuid: &pc.Uuid{Value: "11d3902e-d9bb-49a7-bb27-cd7261ef3217"},
Uuid: "11d3902e-d9bb-49a7-bb27-cd7261ef3217",
BlockSize: 512,
BlocksCount: 131072,
},
{
Name: "Malloc1",
Uuid: &pc.Uuid{Value: "88112c76-8c49-4395-955a-0d695b1d2099"},
Uuid: "88112c76-8c49-4395-955a-0d695b1d2099",
BlockSize: 512,
BlocksCount: 131072,
},
Expand All @@ -418,13 +417,13 @@ func TestBackEnd_ListNullVolumes(t *testing.T) {
out: []*pb.NullVolume{
{
Name: "Malloc0",
Uuid: &pc.Uuid{Value: "11d3902e-d9bb-49a7-bb27-cd7261ef3217"},
Uuid: "11d3902e-d9bb-49a7-bb27-cd7261ef3217",
BlockSize: 512,
BlocksCount: 131072,
},
{
Name: "Malloc1",
Uuid: &pc.Uuid{Value: "88112c76-8c49-4395-955a-0d695b1d2099"},
Uuid: "88112c76-8c49-4395-955a-0d695b1d2099",
BlockSize: 512,
BlocksCount: 131072,
},
Expand Down Expand Up @@ -458,7 +457,7 @@ func TestBackEnd_ListNullVolumes(t *testing.T) {
out: []*pb.NullVolume{
{
Name: "Malloc0",
Uuid: &pc.Uuid{Value: "11d3902e-d9bb-49a7-bb27-cd7261ef3217"},
Uuid: "11d3902e-d9bb-49a7-bb27-cd7261ef3217",
BlockSize: 512,
BlocksCount: 131072,
},
Expand All @@ -474,7 +473,7 @@ func TestBackEnd_ListNullVolumes(t *testing.T) {
out: []*pb.NullVolume{
{
Name: "Malloc1",
Uuid: &pc.Uuid{Value: "88112c76-8c49-4395-955a-0d695b1d2099"},
Uuid: "88112c76-8c49-4395-955a-0d695b1d2099",
BlockSize: 512,
BlocksCount: 131072,
},
Expand Down Expand Up @@ -504,7 +503,7 @@ func TestBackEnd_ListNullVolumes(t *testing.T) {

testEnv.opiSpdkServer.Pagination["existing-pagination-token"] = 1

request := &pb.ListNullVolumesRequest{Parent: tt.in, PageSize: tt.size, PageToken: tt.token}
request := &pb.ListNullVolumesRequest{PageSize: tt.size, PageToken: tt.token}
response, err := testEnv.client.ListNullVolumes(testEnv.ctx, request)

if !utils.EqualProtoSlices(response.GetNullVolumes(), tt.out) {
Expand Down Expand Up @@ -577,7 +576,7 @@ func TestBackEnd_GetNullVolume(t *testing.T) {
in: testNullVolumeName,
out: &pb.NullVolume{
Name: "Malloc1",
Uuid: &pc.Uuid{Value: "88112c76-8c49-4395-955a-0d695b1d2099"},
Uuid: "88112c76-8c49-4395-955a-0d695b1d2099",
BlockSize: 512,
BlocksCount: 131072,
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/backend/nvme_path.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries.
// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries.
// Copyright (C) 2023 Intel Corporation

// Package backend implements the BackEnd APIs (network facing) of the storage Server
Expand Down Expand Up @@ -63,7 +63,7 @@ func (s *Server) CreateNvmePath(ctx context.Context, in *pb.CreateNvmePathReques
}

// TODO: consider moving to _validate.go
if in.NvmePath.Trtype == pb.NvmeTransportType_NVME_TRANSPORT_PCIE && controller.Tcp != nil {
if in.NvmePath.Trtype == pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE && controller.Tcp != nil {
err := status.Errorf(codes.FailedPrecondition, "pcie transport on tcp controller is not allowed")
return nil, err
}
Expand Down
Loading
Loading