Skip to content

Commit fd195fe

Browse files
authored
Merge pull request #863 from andyzhangx/upgrade-csi-spec
chore: update CSI spec to v1.10.0
2 parents 3d4721a + 1715f7e commit fd195fe

File tree

11 files changed

+8556
-4356
lines changed

11 files changed

+8556
-4356
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/Azure/go-autorest/autorest v0.11.29
88
github.com/Azure/go-autorest/autorest/adal v0.9.23
99
github.com/Azure/go-autorest/autorest/to v0.4.0
10-
github.com/container-storage-interface/spec v1.8.0
10+
github.com/container-storage-interface/spec v1.11.0
1111
github.com/golang/protobuf v1.5.4
1212
github.com/kubernetes-csi/csi-lib-utils v0.13.0
1313
github.com/kubernetes-csi/csi-proxy/client v1.0.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
5555
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
5656
github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw=
5757
github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
58-
github.com/container-storage-interface/spec v1.8.0 h1:D0vhF3PLIZwlwZEf2eNbpujGCNwspwTYf2idJRJx4xI=
59-
github.com/container-storage-interface/spec v1.8.0/go.mod h1:ROLik+GhPslwwWRNFF1KasPzroNARibH2rfz1rkg4H0=
58+
github.com/container-storage-interface/spec v1.11.0 h1:H/YKTOeUZwHtyPOr9raR+HgFmGluGCklulxDYxSdVNM=
59+
github.com/container-storage-interface/spec v1.11.0/go.mod h1:DtUvaQszPml1YJfIK7c00mlv6/g4wNMLanLgiUbKFRI=
6060
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
6161
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
6262
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=

pkg/csi-common/utils_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ func TestLogGRPC(t *testing.T) {
116116
"account_name": "k8s",
117117
"account_key": "testkey",
118118
},
119-
XXX_sizecache: 100,
120119
},
121120
`GRPC request: {"secrets":"***stripped***","volume_id":"vol_1"}`,
122121
},
@@ -202,7 +201,6 @@ func TestNewControllerServiceCapability(t *testing.T) {
202201
for _, test := range tests {
203202
resp := NewControllerServiceCapability(test.cap)
204203
assert.NotNil(t, resp)
205-
assert.Equal(t, resp.XXX_sizecache, int32(0))
206204
}
207205
}
208206

@@ -226,7 +224,6 @@ func TestNewNodeServiceCapability(t *testing.T) {
226224
for _, test := range tests {
227225
resp := NewNodeServiceCapability(test.cap)
228226
assert.NotNil(t, resp)
229-
assert.Equal(t, resp.XXX_sizecache, int32(0))
230227
}
231228
}
232229

pkg/smb/controllerserver_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,30 +317,30 @@ func TestValidateVolumeCapabilities(t *testing.T) {
317317

318318
tests := []struct {
319319
desc string
320-
req csi.ValidateVolumeCapabilitiesRequest
320+
req *csi.ValidateVolumeCapabilitiesRequest
321321
expectedErr error
322322
}{
323323
{
324324
desc: "Volume ID missing",
325-
req: csi.ValidateVolumeCapabilitiesRequest{},
325+
req: &csi.ValidateVolumeCapabilitiesRequest{},
326326
expectedErr: status.Error(codes.InvalidArgument, "Volume ID missing in request"),
327327
},
328328
{
329329
desc: "Volume capabilities missing",
330-
req: csi.ValidateVolumeCapabilitiesRequest{VolumeId: "vol_1"},
330+
req: &csi.ValidateVolumeCapabilitiesRequest{VolumeId: "vol_1"},
331331
expectedErr: status.Error(codes.InvalidArgument, "volume capabilities missing in request"),
332332
},
333333
{
334334
desc: "block volume capability not supported",
335-
req: csi.ValidateVolumeCapabilitiesRequest{
335+
req: &csi.ValidateVolumeCapabilitiesRequest{
336336
VolumeId: "vol_1",
337337
VolumeCapabilities: blockVolCap,
338338
},
339339
expectedErr: status.Error(codes.InvalidArgument, "block volume capability not supported"),
340340
},
341341
{
342342
desc: "Valid request",
343-
req: csi.ValidateVolumeCapabilitiesRequest{
343+
req: &csi.ValidateVolumeCapabilitiesRequest{
344344
VolumeId: "vol_1#f5713de20cde511e8ba4900#fileshare#diskname#",
345345
VolumeCapabilities: mountVolCap,
346346
},
@@ -349,7 +349,7 @@ func TestValidateVolumeCapabilities(t *testing.T) {
349349
}
350350

351351
for _, test := range tests {
352-
_, err := d.ValidateVolumeCapabilities(context.Background(), &test.req)
352+
_, err := d.ValidateVolumeCapabilities(context.Background(), test.req)
353353
if !reflect.DeepEqual(err, test.expectedErr) {
354354
t.Errorf("[test: %s] Unexpected error: %v, expected error: %v", test.desc, err, test.expectedErr)
355355
}

pkg/smb/identityserver_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ func TestProbe(t *testing.T) {
6868
resp, err := d.Probe(context.Background(), &req)
6969
assert.NoError(t, err)
7070
assert.NotNil(t, resp)
71-
assert.Equal(t, resp.XXX_sizecache, int32(0))
7271
assert.Equal(t, resp.Ready.Value, true)
7372
}
7473

@@ -87,6 +86,5 @@ func TestGetPluginCapabilities(t *testing.T) {
8786
resp, err := d.GetPluginCapabilities(context.Background(), &req)
8887
assert.NoError(t, err)
8988
assert.NotNil(t, resp)
90-
assert.Equal(t, resp.XXX_sizecache, int32(0))
9189
assert.Equal(t, resp.Capabilities, expectedCap)
9290
}

pkg/smb/nodeserver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ func (d *Driver) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeSta
304304
return nil, status.Errorf(codes.Internal, "%v", err)
305305
}
306306
if cache != nil {
307-
resp := cache.(csi.NodeGetVolumeStatsResponse)
307+
resp := cache.(*csi.NodeGetVolumeStatsResponse)
308308
klog.V(6).Infof("NodeGetVolumeStats: volume stats for volume %s path %s is cached", req.VolumeId, req.VolumePath)
309-
return &resp, nil
309+
return resp, nil
310310
}
311311

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

367367
// cache the volume stats per volume
368-
d.volStatsCache.Set(req.VolumeId, resp)
368+
d.volStatsCache.Set(req.VolumeId, &resp)
369369
return &resp, err
370370
}
371371

0 commit comments

Comments
 (0)