Merge pull request #796 from andyzhangx/upgrade-csi-spec
chore: update CSI spec to v1.10.0
This commit is contained in:
commit
2421ada64e
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ module github.com/kubernetes-csi/csi-driver-nfs
|
|||||||
go 1.23.1
|
go 1.23.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/container-storage-interface/spec v1.8.0
|
github.com/container-storage-interface/spec v1.11.0
|
||||||
github.com/kubernetes-csi/csi-lib-utils v0.9.0
|
github.com/kubernetes-csi/csi-lib-utils v0.9.0
|
||||||
github.com/onsi/ginkgo/v2 v2.21.0
|
github.com/onsi/ginkgo/v2 v2.21.0
|
||||||
github.com/onsi/gomega v1.35.1
|
github.com/onsi/gomega v1.35.1
|
||||||
|
|||||||
4
go.sum
4
go.sum
@ -85,8 +85,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
|
|||||||
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 h1:QVw89YDxXxEe+l8gU8ETbOasdwEV+avkR75ZzsVV9WI=
|
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 h1:QVw89YDxXxEe+l8gU8ETbOasdwEV+avkR75ZzsVV9WI=
|
||||||
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
|
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
|
||||||
github.com/container-storage-interface/spec v1.2.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4=
|
github.com/container-storage-interface/spec v1.2.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4=
|
||||||
github.com/container-storage-interface/spec v1.8.0 h1:D0vhF3PLIZwlwZEf2eNbpujGCNwspwTYf2idJRJx4xI=
|
github.com/container-storage-interface/spec v1.11.0 h1:H/YKTOeUZwHtyPOr9raR+HgFmGluGCklulxDYxSdVNM=
|
||||||
github.com/container-storage-interface/spec v1.8.0/go.mod h1:ROLik+GhPslwwWRNFF1KasPzroNARibH2rfz1rkg4H0=
|
github.com/container-storage-interface/spec v1.11.0/go.mod h1:DtUvaQszPml1YJfIK7c00mlv6/g4wNMLanLgiUbKFRI=
|
||||||
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
|
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
|
||||||
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
|
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
|
||||||
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
|
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
|
||||||
|
|||||||
@ -40,6 +40,7 @@ import (
|
|||||||
// ControllerServer controller server setting
|
// ControllerServer controller server setting
|
||||||
type ControllerServer struct {
|
type ControllerServer struct {
|
||||||
Driver *Driver
|
Driver *Driver
|
||||||
|
csi.UnimplementedControllerServer
|
||||||
}
|
}
|
||||||
|
|
||||||
// nfsVolume is an internal representation of a volume
|
// nfsVolume is an internal representation of a volume
|
||||||
@ -347,6 +348,10 @@ func (cs *ControllerServer) GetCapacity(_ context.Context, _ *csi.GetCapacityReq
|
|||||||
return nil, status.Error(codes.Unimplemented, "")
|
return nil, status.Error(codes.Unimplemented, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *Driver) ControllerModifyVolume(_ context.Context, _ *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "")
|
||||||
|
}
|
||||||
|
|
||||||
// ControllerGetCapabilities implements the default GRPC callout.
|
// ControllerGetCapabilities implements the default GRPC callout.
|
||||||
// Default supports all capabilities
|
// Default supports all capabilities
|
||||||
func (cs *ControllerServer) ControllerGetCapabilities(_ context.Context, _ *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) {
|
func (cs *ControllerServer) ControllerGetCapabilities(_ context.Context, _ *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) {
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import (
|
|||||||
|
|
||||||
type IdentityServer struct {
|
type IdentityServer struct {
|
||||||
Driver *Driver
|
Driver *Driver
|
||||||
|
csi.UnimplementedIdentityServer
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ids *IdentityServer) GetPluginInfo(_ context.Context, _ *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
|
func (ids *IdentityServer) GetPluginInfo(_ context.Context, _ *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
|
||||||
|
|||||||
@ -73,7 +73,6 @@ func TestProbe(t *testing.T) {
|
|||||||
resp, err := fakeIdentityServer.Probe(context.Background(), &req)
|
resp, err := fakeIdentityServer.Probe(context.Background(), &req)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.NotNil(t, resp)
|
assert.NotNil(t, resp)
|
||||||
assert.Equal(t, resp.XXX_sizecache, int32(0))
|
|
||||||
assert.Equal(t, resp.Ready.Value, true)
|
assert.Equal(t, resp.Ready.Value, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +95,6 @@ func TestGetPluginCapabilities(t *testing.T) {
|
|||||||
resp, err := fakeIdentityServer.GetPluginCapabilities(context.Background(), &req)
|
resp, err := fakeIdentityServer.GetPluginCapabilities(context.Background(), &req)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.NotNil(t, resp)
|
assert.NotNil(t, resp)
|
||||||
assert.Equal(t, resp.XXX_sizecache, int32(0))
|
|
||||||
assert.Equal(t, resp.Capabilities, expectedCap)
|
assert.Equal(t, resp.Capabilities, expectedCap)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -154,7 +154,6 @@ func TestNewControllerServiceCapability(t *testing.T) {
|
|||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
resp := NewControllerServiceCapability(test.cap)
|
resp := NewControllerServiceCapability(test.cap)
|
||||||
assert.NotNil(t, resp)
|
assert.NotNil(t, resp)
|
||||||
assert.Equal(t, resp.XXX_sizecache, int32(0))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +177,6 @@ func TestNewNodeServiceCapability(t *testing.T) {
|
|||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
resp := NewNodeServiceCapability(test.cap)
|
resp := NewNodeServiceCapability(test.cap)
|
||||||
assert.NotNil(t, resp)
|
assert.NotNil(t, resp)
|
||||||
assert.Equal(t, resp.XXX_sizecache, int32(0))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ import (
|
|||||||
type NodeServer struct {
|
type NodeServer struct {
|
||||||
Driver *Driver
|
Driver *Driver
|
||||||
mounter mount.Interface
|
mounter mount.Interface
|
||||||
|
csi.UnimplementedNodeServer
|
||||||
}
|
}
|
||||||
|
|
||||||
// NodePublishVolume mount the volume
|
// NodePublishVolume mount the volume
|
||||||
@ -223,9 +224,9 @@ func (ns *NodeServer) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolu
|
|||||||
return nil, status.Errorf(codes.Internal, "%v", err)
|
return nil, status.Errorf(codes.Internal, "%v", err)
|
||||||
}
|
}
|
||||||
if cache != nil {
|
if cache != nil {
|
||||||
resp := cache.(csi.NodeGetVolumeStatsResponse)
|
resp := cache.(*csi.NodeGetVolumeStatsResponse)
|
||||||
klog.V(6).Infof("NodeGetVolumeStats: volume stats for volume %s path %s is cached", req.VolumeId, req.VolumePath)
|
klog.V(6).Infof("NodeGetVolumeStats: volume stats for volume %s path %s is cached", req.VolumeId, req.VolumePath)
|
||||||
return &resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Lstat(req.VolumePath); err != nil {
|
if _, err := os.Lstat(req.VolumePath); err != nil {
|
||||||
@ -284,7 +285,7 @@ func (ns *NodeServer) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolu
|
|||||||
}
|
}
|
||||||
|
|
||||||
// cache the volume stats per volume
|
// cache the volume stats per volume
|
||||||
ns.Driver.volStatsCache.Set(req.VolumeId, resp)
|
ns.Driver.volStatsCache.Set(req.VolumeId, &resp)
|
||||||
return &resp, err
|
return &resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,24 +74,24 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
tests := []struct {
|
tests := []struct {
|
||||||
desc string
|
desc string
|
||||||
setup func()
|
setup func()
|
||||||
req csi.NodePublishVolumeRequest
|
req *csi.NodePublishVolumeRequest
|
||||||
skipOnWindows bool
|
skipOnWindows bool
|
||||||
expectedErr error
|
expectedErr error
|
||||||
cleanup func()
|
cleanup func()
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
desc: "[Error] Volume capabilities missing",
|
desc: "[Error] Volume capabilities missing",
|
||||||
req: csi.NodePublishVolumeRequest{},
|
req: &csi.NodePublishVolumeRequest{},
|
||||||
expectedErr: status.Error(codes.InvalidArgument, "Volume capability missing in request"),
|
expectedErr: status.Error(codes.InvalidArgument, "Volume capability missing in request"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Error] Volume ID missing",
|
desc: "[Error] Volume ID missing",
|
||||||
req: csi.NodePublishVolumeRequest{VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap}},
|
req: &csi.NodePublishVolumeRequest{VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap}},
|
||||||
expectedErr: status.Error(codes.InvalidArgument, "Volume ID missing in request"),
|
expectedErr: status.Error(codes.InvalidArgument, "Volume ID missing in request"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Error] Target path missing",
|
desc: "[Error] Target path missing",
|
||||||
req: csi.NodePublishVolumeRequest{VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
req: &csi.NodePublishVolumeRequest{VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
||||||
VolumeId: "vol_1"},
|
VolumeId: "vol_1"},
|
||||||
expectedErr: status.Error(codes.InvalidArgument, "Target path not provided"),
|
expectedErr: status.Error(codes.InvalidArgument, "Target path not provided"),
|
||||||
},
|
},
|
||||||
@ -100,7 +100,7 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
setup: func() {
|
setup: func() {
|
||||||
ns.Driver.volumeLocks.TryAcquire(lockKey)
|
ns.Driver.volumeLocks.TryAcquire(lockKey)
|
||||||
},
|
},
|
||||||
req: csi.NodePublishVolumeRequest{VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
req: &csi.NodePublishVolumeRequest{VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
||||||
VolumeId: "vol_1",
|
VolumeId: "vol_1",
|
||||||
VolumeContext: params,
|
VolumeContext: params,
|
||||||
TargetPath: targetTest},
|
TargetPath: targetTest},
|
||||||
@ -111,7 +111,7 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Success] Stage target path missing",
|
desc: "[Success] Stage target path missing",
|
||||||
req: csi.NodePublishVolumeRequest{
|
req: &csi.NodePublishVolumeRequest{
|
||||||
VolumeContext: params,
|
VolumeContext: params,
|
||||||
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
||||||
VolumeId: "vol_1",
|
VolumeId: "vol_1",
|
||||||
@ -120,7 +120,7 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Success] Valid request read only",
|
desc: "[Success] Valid request read only",
|
||||||
req: csi.NodePublishVolumeRequest{
|
req: &csi.NodePublishVolumeRequest{
|
||||||
VolumeContext: params,
|
VolumeContext: params,
|
||||||
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
||||||
VolumeId: "vol_1",
|
VolumeId: "vol_1",
|
||||||
@ -130,7 +130,7 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Success] Valid request already mounted",
|
desc: "[Success] Valid request already mounted",
|
||||||
req: csi.NodePublishVolumeRequest{
|
req: &csi.NodePublishVolumeRequest{
|
||||||
VolumeContext: params,
|
VolumeContext: params,
|
||||||
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
||||||
VolumeId: "vol_1",
|
VolumeId: "vol_1",
|
||||||
@ -140,7 +140,7 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Success] Valid request",
|
desc: "[Success] Valid request",
|
||||||
req: csi.NodePublishVolumeRequest{
|
req: &csi.NodePublishVolumeRequest{
|
||||||
VolumeContext: params,
|
VolumeContext: params,
|
||||||
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
||||||
VolumeId: "vol_1",
|
VolumeId: "vol_1",
|
||||||
@ -150,7 +150,7 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Success] Valid request with pv/pvc metadata",
|
desc: "[Success] Valid request with pv/pvc metadata",
|
||||||
req: csi.NodePublishVolumeRequest{
|
req: &csi.NodePublishVolumeRequest{
|
||||||
VolumeContext: paramsWithMetadata,
|
VolumeContext: paramsWithMetadata,
|
||||||
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
||||||
VolumeId: "vol_1",
|
VolumeId: "vol_1",
|
||||||
@ -160,7 +160,7 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Success] Valid request with 0 mountPermissions",
|
desc: "[Success] Valid request with 0 mountPermissions",
|
||||||
req: csi.NodePublishVolumeRequest{
|
req: &csi.NodePublishVolumeRequest{
|
||||||
VolumeContext: paramsWithZeroPermissions,
|
VolumeContext: paramsWithZeroPermissions,
|
||||||
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
||||||
VolumeId: "vol_1",
|
VolumeId: "vol_1",
|
||||||
@ -170,7 +170,7 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Error] invalid mountPermissions",
|
desc: "[Error] invalid mountPermissions",
|
||||||
req: csi.NodePublishVolumeRequest{
|
req: &csi.NodePublishVolumeRequest{
|
||||||
VolumeContext: invalidParams,
|
VolumeContext: invalidParams,
|
||||||
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
VolumeCapability: &csi.VolumeCapability{AccessMode: &volumeCap},
|
||||||
VolumeId: "vol_1",
|
VolumeId: "vol_1",
|
||||||
@ -188,7 +188,7 @@ func TestNodePublishVolume(t *testing.T) {
|
|||||||
if tc.setup != nil {
|
if tc.setup != nil {
|
||||||
tc.setup()
|
tc.setup()
|
||||||
}
|
}
|
||||||
_, err := ns.NodePublishVolume(context.Background(), &tc.req)
|
_, err := ns.NodePublishVolume(context.Background(), tc.req)
|
||||||
if !reflect.DeepEqual(err, tc.expectedErr) {
|
if !reflect.DeepEqual(err, tc.expectedErr) {
|
||||||
t.Errorf("Desc:%v\nUnexpected error: %v\nExpected: %v", tc.desc, err, tc.expectedErr)
|
t.Errorf("Desc:%v\nUnexpected error: %v\nExpected: %v", tc.desc, err, tc.expectedErr)
|
||||||
}
|
}
|
||||||
@ -219,30 +219,30 @@ func TestNodeUnpublishVolume(t *testing.T) {
|
|||||||
tests := []struct {
|
tests := []struct {
|
||||||
desc string
|
desc string
|
||||||
setup func()
|
setup func()
|
||||||
req csi.NodeUnpublishVolumeRequest
|
req *csi.NodeUnpublishVolumeRequest
|
||||||
expectedErr error
|
expectedErr error
|
||||||
cleanup func()
|
cleanup func()
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
desc: "[Error] Volume ID missing",
|
desc: "[Error] Volume ID missing",
|
||||||
req: csi.NodeUnpublishVolumeRequest{TargetPath: targetTest},
|
req: &csi.NodeUnpublishVolumeRequest{TargetPath: targetTest},
|
||||||
expectedErr: status.Error(codes.InvalidArgument, "Volume ID missing in request"),
|
expectedErr: status.Error(codes.InvalidArgument, "Volume ID missing in request"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Error] Target missing",
|
desc: "[Error] Target missing",
|
||||||
req: csi.NodeUnpublishVolumeRequest{VolumeId: "vol_1"},
|
req: &csi.NodeUnpublishVolumeRequest{VolumeId: "vol_1"},
|
||||||
expectedErr: status.Error(codes.InvalidArgument, "Target path missing in request"),
|
expectedErr: status.Error(codes.InvalidArgument, "Target path missing in request"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Success] Volume not mounted",
|
desc: "[Success] Volume not mounted",
|
||||||
req: csi.NodeUnpublishVolumeRequest{TargetPath: targetFile, VolumeId: "vol_1"},
|
req: &csi.NodeUnpublishVolumeRequest{TargetPath: targetFile, VolumeId: "vol_1"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Error] Volume operation in progress",
|
desc: "[Error] Volume operation in progress",
|
||||||
setup: func() {
|
setup: func() {
|
||||||
ns.Driver.volumeLocks.TryAcquire(lockKey)
|
ns.Driver.volumeLocks.TryAcquire(lockKey)
|
||||||
},
|
},
|
||||||
req: csi.NodeUnpublishVolumeRequest{TargetPath: targetTest, VolumeId: "vol_1"},
|
req: &csi.NodeUnpublishVolumeRequest{TargetPath: targetTest, VolumeId: "vol_1"},
|
||||||
expectedErr: status.Error(codes.Aborted, fmt.Sprintf(volumeOperationAlreadyExistsFmt, "vol_1")),
|
expectedErr: status.Error(codes.Aborted, fmt.Sprintf(volumeOperationAlreadyExistsFmt, "vol_1")),
|
||||||
cleanup: func() {
|
cleanup: func() {
|
||||||
ns.Driver.volumeLocks.Release(lockKey)
|
ns.Driver.volumeLocks.Release(lockKey)
|
||||||
@ -257,7 +257,7 @@ func TestNodeUnpublishVolume(t *testing.T) {
|
|||||||
if tc.setup != nil {
|
if tc.setup != nil {
|
||||||
tc.setup()
|
tc.setup()
|
||||||
}
|
}
|
||||||
_, err := ns.NodeUnpublishVolume(context.Background(), &tc.req)
|
_, err := ns.NodeUnpublishVolume(context.Background(), tc.req)
|
||||||
if !reflect.DeepEqual(err, tc.expectedErr) {
|
if !reflect.DeepEqual(err, tc.expectedErr) {
|
||||||
if err == nil || tc.expectedErr == nil || !strings.Contains(err.Error(), tc.expectedErr.Error()) {
|
if err == nil || tc.expectedErr == nil || !strings.Contains(err.Error(), tc.expectedErr.Error()) {
|
||||||
t.Errorf("Desc:%v\nUnexpected error: %v\nExpected: %v", tc.desc, err, tc.expectedErr)
|
t.Errorf("Desc:%v\nUnexpected error: %v\nExpected: %v", tc.desc, err, tc.expectedErr)
|
||||||
@ -329,27 +329,27 @@ func TestNodeGetVolumeStats(t *testing.T) {
|
|||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
desc string
|
desc string
|
||||||
req csi.NodeGetVolumeStatsRequest
|
req *csi.NodeGetVolumeStatsRequest
|
||||||
expectedErr error
|
expectedErr error
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
desc: "[Error] Volume ID missing",
|
desc: "[Error] Volume ID missing",
|
||||||
req: csi.NodeGetVolumeStatsRequest{VolumePath: targetTest},
|
req: &csi.NodeGetVolumeStatsRequest{VolumePath: targetTest},
|
||||||
expectedErr: status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume ID was empty"),
|
expectedErr: status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume ID was empty"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Error] VolumePath missing",
|
desc: "[Error] VolumePath missing",
|
||||||
req: csi.NodeGetVolumeStatsRequest{VolumeId: "vol_1"},
|
req: &csi.NodeGetVolumeStatsRequest{VolumeId: "vol_1"},
|
||||||
expectedErr: status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume path was empty"),
|
expectedErr: status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume path was empty"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Error] Incorrect volume path",
|
desc: "[Error] Incorrect volume path",
|
||||||
req: csi.NodeGetVolumeStatsRequest{VolumePath: nonexistedPath, VolumeId: "vol_1"},
|
req: &csi.NodeGetVolumeStatsRequest{VolumePath: nonexistedPath, VolumeId: "vol_1"},
|
||||||
expectedErr: status.Errorf(codes.NotFound, "path /not/a/real/directory does not exist"),
|
expectedErr: status.Errorf(codes.NotFound, "path /not/a/real/directory does not exist"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "[Success] Standard success",
|
desc: "[Success] Standard success",
|
||||||
req: csi.NodeGetVolumeStatsRequest{VolumePath: fakePath, VolumeId: "vol_1"},
|
req: &csi.NodeGetVolumeStatsRequest{VolumePath: fakePath, VolumeId: "vol_1"},
|
||||||
expectedErr: nil,
|
expectedErr: nil,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -362,7 +362,7 @@ func TestNodeGetVolumeStats(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
_, err := ns.NodeGetVolumeStats(context.Background(), &test.req)
|
_, err := ns.NodeGetVolumeStats(context.Background(), test.req)
|
||||||
if !reflect.DeepEqual(err, test.expectedErr) {
|
if !reflect.DeepEqual(err, test.expectedErr) {
|
||||||
t.Errorf("desc: %v, expected error: %v, actual error: %v", test.desc, test.expectedErr, err)
|
t.Errorf("desc: %v, expected error: %v, actual error: %v", test.desc, test.expectedErr, err)
|
||||||
}
|
}
|
||||||
|
|||||||
11880
vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go
generated
vendored
11880
vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
1487
vendor/github.com/container-storage-interface/spec/lib/go/csi/csi_grpc.pb.go
generated
vendored
Normal file
1487
vendor/github.com/container-storage-interface/spec/lib/go/csi/csi_grpc.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
71
vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
generated
vendored
71
vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
generated
vendored
@ -1,71 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// source: github.com/golang/protobuf/ptypes/wrappers/wrappers.proto
|
|
||||||
|
|
||||||
package wrappers
|
|
||||||
|
|
||||||
import (
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
|
||||||
reflect "reflect"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Symbols defined in public import of google/protobuf/wrappers.proto.
|
|
||||||
|
|
||||||
type DoubleValue = wrapperspb.DoubleValue
|
|
||||||
type FloatValue = wrapperspb.FloatValue
|
|
||||||
type Int64Value = wrapperspb.Int64Value
|
|
||||||
type UInt64Value = wrapperspb.UInt64Value
|
|
||||||
type Int32Value = wrapperspb.Int32Value
|
|
||||||
type UInt32Value = wrapperspb.UInt32Value
|
|
||||||
type BoolValue = wrapperspb.BoolValue
|
|
||||||
type StringValue = wrapperspb.StringValue
|
|
||||||
type BytesValue = wrapperspb.BytesValue
|
|
||||||
|
|
||||||
var File_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
var file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_rawDesc = []byte{
|
|
||||||
0x0a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
|
|
||||||
0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
|
|
||||||
0x70, 0x65, 0x73, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2f, 0x77, 0x72, 0x61,
|
|
||||||
0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f,
|
|
||||||
0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61,
|
|
||||||
0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x35, 0x5a, 0x33, 0x67,
|
|
||||||
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67,
|
|
||||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73,
|
|
||||||
0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x3b, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65,
|
|
||||||
0x72, 0x73, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_goTypes = []interface{}{}
|
|
||||||
var file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_depIdxs = []int32{
|
|
||||||
0, // [0:0] is the sub-list for method output_type
|
|
||||||
0, // [0:0] is the sub-list for method input_type
|
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
|
||||||
0, // [0:0] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_init() }
|
|
||||||
func file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_init() {
|
|
||||||
if File_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_rawDesc,
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 0,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 0,
|
|
||||||
},
|
|
||||||
GoTypes: file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_goTypes,
|
|
||||||
DependencyIndexes: file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_depIdxs,
|
|
||||||
}.Build()
|
|
||||||
File_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto = out.File
|
|
||||||
file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_rawDesc = nil
|
|
||||||
file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_goTypes = nil
|
|
||||||
file_github_com_golang_protobuf_ptypes_wrappers_wrappers_proto_depIdxs = nil
|
|
||||||
}
|
|
||||||
3
vendor/modules.txt
vendored
3
vendor/modules.txt
vendored
@ -19,7 +19,7 @@ github.com/cenkalti/backoff/v4
|
|||||||
# github.com/cespare/xxhash/v2 v2.3.0
|
# github.com/cespare/xxhash/v2 v2.3.0
|
||||||
## explicit; go 1.11
|
## explicit; go 1.11
|
||||||
github.com/cespare/xxhash/v2
|
github.com/cespare/xxhash/v2
|
||||||
# github.com/container-storage-interface/spec v1.8.0
|
# github.com/container-storage-interface/spec v1.11.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/container-storage-interface/spec/lib/go/csi
|
github.com/container-storage-interface/spec/lib/go/csi
|
||||||
# github.com/coreos/go-semver v0.3.1
|
# github.com/coreos/go-semver v0.3.1
|
||||||
@ -87,7 +87,6 @@ github.com/golang/protobuf/ptypes
|
|||||||
github.com/golang/protobuf/ptypes/any
|
github.com/golang/protobuf/ptypes/any
|
||||||
github.com/golang/protobuf/ptypes/duration
|
github.com/golang/protobuf/ptypes/duration
|
||||||
github.com/golang/protobuf/ptypes/timestamp
|
github.com/golang/protobuf/ptypes/timestamp
|
||||||
github.com/golang/protobuf/ptypes/wrappers
|
|
||||||
# github.com/google/cel-go v0.16.1
|
# github.com/google/cel-go v0.16.1
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/google/cel-go/cel
|
github.com/google/cel-go/cel
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user