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

chore: update CSI spec to v1.10.0 #863

Merged
merged 2 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/Azure/go-autorest/autorest v0.11.29
github.com/Azure/go-autorest/autorest/adal v0.9.23
github.com/Azure/go-autorest/autorest/to v0.4.0
github.com/container-storage-interface/spec v1.8.0
github.com/container-storage-interface/spec v1.11.0
github.com/golang/protobuf v1.5.4
github.com/kubernetes-csi/csi-lib-utils v0.13.0
github.com/kubernetes-csi/csi-proxy/client v1.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw=
github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/container-storage-interface/spec v1.8.0 h1:D0vhF3PLIZwlwZEf2eNbpujGCNwspwTYf2idJRJx4xI=
github.com/container-storage-interface/spec v1.8.0/go.mod h1:ROLik+GhPslwwWRNFF1KasPzroNARibH2rfz1rkg4H0=
github.com/container-storage-interface/spec v1.11.0 h1:H/YKTOeUZwHtyPOr9raR+HgFmGluGCklulxDYxSdVNM=
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/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
Expand Down
3 changes: 0 additions & 3 deletions pkg/csi-common/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ func TestLogGRPC(t *testing.T) {
"account_name": "k8s",
"account_key": "testkey",
},
XXX_sizecache: 100,
},
`GRPC request: {"secrets":"***stripped***","volume_id":"vol_1"}`,
},
Expand Down Expand Up @@ -202,7 +201,6 @@ func TestNewControllerServiceCapability(t *testing.T) {
for _, test := range tests {
resp := NewControllerServiceCapability(test.cap)
assert.NotNil(t, resp)
assert.Equal(t, resp.XXX_sizecache, int32(0))
}
}

Expand All @@ -226,7 +224,6 @@ func TestNewNodeServiceCapability(t *testing.T) {
for _, test := range tests {
resp := NewNodeServiceCapability(test.cap)
assert.NotNil(t, resp)
assert.Equal(t, resp.XXX_sizecache, int32(0))
}
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/smb/controllerserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,30 +317,30 @@ func TestValidateVolumeCapabilities(t *testing.T) {

tests := []struct {
desc string
req csi.ValidateVolumeCapabilitiesRequest
req *csi.ValidateVolumeCapabilitiesRequest
expectedErr error
}{
{
desc: "Volume ID missing",
req: csi.ValidateVolumeCapabilitiesRequest{},
req: &csi.ValidateVolumeCapabilitiesRequest{},
expectedErr: status.Error(codes.InvalidArgument, "Volume ID missing in request"),
},
{
desc: "Volume capabilities missing",
req: csi.ValidateVolumeCapabilitiesRequest{VolumeId: "vol_1"},
req: &csi.ValidateVolumeCapabilitiesRequest{VolumeId: "vol_1"},
expectedErr: status.Error(codes.InvalidArgument, "volume capabilities missing in request"),
},
{
desc: "block volume capability not supported",
req: csi.ValidateVolumeCapabilitiesRequest{
req: &csi.ValidateVolumeCapabilitiesRequest{
VolumeId: "vol_1",
VolumeCapabilities: blockVolCap,
},
expectedErr: status.Error(codes.InvalidArgument, "block volume capability not supported"),
},
{
desc: "Valid request",
req: csi.ValidateVolumeCapabilitiesRequest{
req: &csi.ValidateVolumeCapabilitiesRequest{
VolumeId: "vol_1#f5713de20cde511e8ba4900#fileshare#diskname#",
VolumeCapabilities: mountVolCap,
},
Expand All @@ -349,7 +349,7 @@ func TestValidateVolumeCapabilities(t *testing.T) {
}

for _, test := range tests {
_, err := d.ValidateVolumeCapabilities(context.Background(), &test.req)
_, err := d.ValidateVolumeCapabilities(context.Background(), test.req)
if !reflect.DeepEqual(err, test.expectedErr) {
t.Errorf("[test: %s] Unexpected error: %v, expected error: %v", test.desc, err, test.expectedErr)
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/smb/identityserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func TestProbe(t *testing.T) {
resp, err := d.Probe(context.Background(), &req)
assert.NoError(t, err)
assert.NotNil(t, resp)
assert.Equal(t, resp.XXX_sizecache, int32(0))
assert.Equal(t, resp.Ready.Value, true)
}

Expand All @@ -87,6 +86,5 @@ func TestGetPluginCapabilities(t *testing.T) {
resp, err := d.GetPluginCapabilities(context.Background(), &req)
assert.NoError(t, err)
assert.NotNil(t, resp)
assert.Equal(t, resp.XXX_sizecache, int32(0))
assert.Equal(t, resp.Capabilities, expectedCap)
}
6 changes: 3 additions & 3 deletions pkg/smb/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ func (d *Driver) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeSta
return nil, status.Errorf(codes.Internal, "%v", err)
}
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)
return &resp, nil
return resp, nil
}

if _, err := os.Lstat(req.VolumePath); err != nil {
Expand Down Expand Up @@ -365,7 +365,7 @@ func (d *Driver) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeSta
}

// cache the volume stats per volume
d.volStatsCache.Set(req.VolumeId, resp)
d.volStatsCache.Set(req.VolumeId, &resp)
return &resp, err
}

Expand Down
Loading
Loading