Skip to content

Commit 0c2047d

Browse files
authored
Merge pull request #587 from jusjin-org/user/jusjin/refactorblobstruct
chore: enable blob csi driver to reuse csicommon implementation for unimplemented APIs
2 parents 86d6419 + 790f69c commit 0c2047d

8 files changed

+52
-88
lines changed

pkg/blob/blob.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ type DriverOptions struct {
126126
// Driver implements all interfaces of CSI drivers
127127
type Driver struct {
128128
csicommon.CSIDriver
129+
130+
// Embed these structs to inherit interfaces implementation from csicommon
131+
// Each of them contains a pointer to CSIDriver struct
132+
csicommon.DefaultIdentityServer
133+
csicommon.DefaultControllerServer
134+
csicommon.DefaultNodeServer
135+
129136
cloud *azure.Cloud
130137
cloudConfigSecretName string
131138
cloudConfigSecretNamespace string
@@ -174,6 +181,10 @@ func NewDriver(options *DriverOptions) *Driver {
174181
d.Version = driverVersion
175182
d.NodeID = options.NodeID
176183

184+
d.DefaultControllerServer.Driver = &d.CSIDriver
185+
d.DefaultIdentityServer.Driver = &d.CSIDriver
186+
d.DefaultNodeServer.Driver = &d.CSIDriver
187+
177188
var err error
178189
getter := func(key string) (interface{}, error) { return nil, nil }
179190
if d.accountSearchCache, err = azcache.NewTimedcache(time.Minute, getter); err != nil {

pkg/blob/controllerserver.go

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -411,48 +411,6 @@ func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.Control
411411
}, nil
412412
}
413413

414-
// GetCapacity returns the capacity of the total available storage pool
415-
func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error) {
416-
return nil, status.Error(codes.Unimplemented, "")
417-
}
418-
419-
// ListVolumes return all available volumes
420-
func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {
421-
return nil, status.Error(codes.Unimplemented, "")
422-
}
423-
424-
// ControllerGetVolume get volume
425-
func (d *Driver) ControllerGetVolume(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error) {
426-
return nil, status.Error(codes.Unimplemented, "")
427-
}
428-
429-
// ControllerPublishVolume make a volume available on some required node
430-
// N/A for blob driver
431-
func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) {
432-
return nil, status.Error(codes.Unimplemented, "")
433-
}
434-
435-
// ControllerUnpublishVolume make the volume unavailable on a specified node
436-
// N/A for blob driver
437-
func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) {
438-
return nil, status.Error(codes.Unimplemented, "")
439-
}
440-
441-
// CreateSnapshot create a snapshot (todo)
442-
func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) {
443-
return nil, status.Error(codes.Unimplemented, "")
444-
}
445-
446-
// DeleteSnapshot delete a snapshot (todo)
447-
func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
448-
return nil, status.Error(codes.Unimplemented, "")
449-
}
450-
451-
// ListSnapshots list all snapshots (todo)
452-
func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) {
453-
return nil, status.Error(codes.Unimplemented, "")
454-
}
455-
456414
// ControllerExpandVolume controller expand volume
457415
func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
458416
if len(req.GetVolumeId()) == 0 {

pkg/blob/controllerserver_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ func TestGetCapacity(t *testing.T) {
492492
req := csi.GetCapacityRequest{}
493493
resp, err := d.GetCapacity(context.Background(), &req)
494494
assert.Nil(t, resp)
495-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
495+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "GetCapacity is not yet implemented")) {
496496
t.Errorf("Unexpected error: %v", err)
497497
}
498498
}
@@ -502,7 +502,7 @@ func TestListVolumes(t *testing.T) {
502502
req := csi.ListVolumesRequest{}
503503
resp, err := d.ListVolumes(context.Background(), &req)
504504
assert.Nil(t, resp)
505-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
505+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ListVolumes is not yet implemented")) {
506506
t.Errorf("Unexpected error: %v", err)
507507
}
508508
}
@@ -512,7 +512,7 @@ func TestControllerPublishVolume(t *testing.T) {
512512
req := csi.ControllerPublishVolumeRequest{}
513513
resp, err := d.ControllerPublishVolume(context.Background(), &req)
514514
assert.Nil(t, resp)
515-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
515+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ControllerPublishVolume is not yet implemented")) {
516516
t.Errorf("Unexpected error: %v", err)
517517
}
518518
}
@@ -522,7 +522,7 @@ func TestControllerUnpublishVolume(t *testing.T) {
522522
req := csi.ControllerUnpublishVolumeRequest{}
523523
resp, err := d.ControllerUnpublishVolume(context.Background(), &req)
524524
assert.Nil(t, resp)
525-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
525+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ControllerUnpublishVolume is not yet implemented")) {
526526
t.Errorf("Unexpected error: %v", err)
527527
}
528528
}
@@ -532,7 +532,7 @@ func TestCreateSnapshots(t *testing.T) {
532532
req := csi.CreateSnapshotRequest{}
533533
resp, err := d.CreateSnapshot(context.Background(), &req)
534534
assert.Nil(t, resp)
535-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
535+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "CreateSnapshot is not yet implemented")) {
536536
t.Errorf("Unexpected error: %v", err)
537537
}
538538
}
@@ -541,7 +541,7 @@ func TestDeleteSnapshots(t *testing.T) {
541541
req := csi.DeleteSnapshotRequest{}
542542
resp, err := d.DeleteSnapshot(context.Background(), &req)
543543
assert.Nil(t, resp)
544-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
544+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "DeleteSnapshot is not yet implemented")) {
545545
t.Errorf("Unexpected error: %v", err)
546546
}
547547
}
@@ -551,7 +551,7 @@ func TestListSnapshots(t *testing.T) {
551551
req := csi.ListSnapshotsRequest{}
552552
resp, err := d.ListSnapshots(context.Background(), &req)
553553
assert.Nil(t, resp)
554-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
554+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ListSnapshots is not yet implemented")) {
555555
t.Errorf("Unexpected error: %v", err)
556556
}
557557
}

pkg/blob/nodeserver.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,6 @@ func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeS
446446
}, nil
447447
}
448448

449-
// NodeExpandVolume node expand volume
450-
func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
451-
return nil, status.Error(codes.Unimplemented, "NodeExpandVolume is not yet implemented")
452-
}
453-
454449
// ensureMountPoint: create mount point if not exists
455450
// return <true, nil> if it's already a mounted point otherwise return <false, nil>
456451
func (d *Driver) ensureMountPoint(target string) (bool, error) {

pkg/csi-common/controllerserver-default.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ type DefaultControllerServer struct {
2828
}
2929

3030
func (cs *DefaultControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
31-
return nil, status.Error(codes.Unimplemented, "")
31+
return nil, status.Error(codes.Unimplemented, "CreateVolume is not yet implemented")
3232
}
3333

3434
func (cs *DefaultControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) {
35-
return nil, status.Error(codes.Unimplemented, "")
35+
return nil, status.Error(codes.Unimplemented, "DeleteVolume is not yet implemented")
3636
}
3737

3838
func (cs *DefaultControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) {
39-
return nil, status.Error(codes.Unimplemented, "")
39+
return nil, status.Error(codes.Unimplemented, "ControllerPublishVolume is not yet implemented")
4040
}
4141

4242
func (cs *DefaultControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) {
43-
return nil, status.Error(codes.Unimplemented, "")
43+
return nil, status.Error(codes.Unimplemented, "ControllerUnpublishVolume is not yet implemented")
4444
}
4545

4646
func (cs *DefaultControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) {
@@ -63,11 +63,11 @@ func (cs *DefaultControllerServer) ValidateVolumeCapabilities(ctx context.Contex
6363
}
6464

6565
func (cs *DefaultControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {
66-
return nil, status.Error(codes.Unimplemented, "")
66+
return nil, status.Error(codes.Unimplemented, "ListVolumes is not yet implemented")
6767
}
6868

6969
func (cs *DefaultControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error) {
70-
return nil, status.Error(codes.Unimplemented, "")
70+
return nil, status.Error(codes.Unimplemented, "GetCapacity is not yet implemented")
7171
}
7272

7373
// ControllerGetCapabilities implements the default GRPC callout.
@@ -79,21 +79,21 @@ func (cs *DefaultControllerServer) ControllerGetCapabilities(ctx context.Context
7979
}
8080

8181
func (cs *DefaultControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) {
82-
return nil, status.Error(codes.Unimplemented, "")
82+
return nil, status.Error(codes.Unimplemented, "CreateSnapshot is not yet implemented")
8383
}
8484

8585
func (cs *DefaultControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
86-
return nil, status.Error(codes.Unimplemented, "")
86+
return nil, status.Error(codes.Unimplemented, "DeleteSnapshot is not yet implemented")
8787
}
8888

8989
func (cs *DefaultControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) {
90-
return nil, status.Error(codes.Unimplemented, "")
90+
return nil, status.Error(codes.Unimplemented, "ListSnapshots is not yet implemented")
9191
}
9292

9393
func (cs *DefaultControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
94-
return nil, status.Error(codes.Unimplemented, "")
94+
return nil, status.Error(codes.Unimplemented, "ControllerExpandVolume is not yet implemented")
9595
}
9696

9797
func (cs *DefaultControllerServer) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error) {
98-
return nil, status.Error(codes.Unimplemented, "")
98+
return nil, status.Error(codes.Unimplemented, "ControllerGetVolume is not yet implemented")
9999
}

pkg/csi-common/controllerserver-default_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func TestCreateVolume(t *testing.T) {
8080
req := csi.CreateVolumeRequest{}
8181
resp, err := cs.CreateVolume(context.Background(), &req)
8282
assert.Nil(t, resp)
83-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
83+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "CreateVolume is not yet implemented")) {
8484
t.Errorf("Unexpected error: %v", err)
8585
}
8686
}
@@ -91,7 +91,7 @@ func TestDeleteVolume(t *testing.T) {
9191
req := csi.DeleteVolumeRequest{}
9292
resp, err := cs.DeleteVolume(context.Background(), &req)
9393
assert.Nil(t, resp)
94-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
94+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "DeleteVolume is not yet implemented")) {
9595
t.Errorf("Unexpected error: %v", err)
9696
}
9797
}
@@ -102,7 +102,7 @@ func TestControllerPublishVolume(t *testing.T) {
102102
req := csi.ControllerPublishVolumeRequest{}
103103
resp, err := cs.ControllerPublishVolume(context.Background(), &req)
104104
assert.Nil(t, resp)
105-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
105+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ControllerPublishVolume is not yet implemented")) {
106106
t.Errorf("Unexpected error: %v", err)
107107
}
108108
}
@@ -113,7 +113,7 @@ func TestControllerUnpublishVolume(t *testing.T) {
113113
req := csi.ControllerUnpublishVolumeRequest{}
114114
resp, err := cs.ControllerUnpublishVolume(context.Background(), &req)
115115
assert.Nil(t, resp)
116-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
116+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ControllerUnpublishVolume is not yet implemented")) {
117117
t.Errorf("Unexpected error: %v", err)
118118
}
119119
}
@@ -124,7 +124,7 @@ func TestGetCapacity(t *testing.T) {
124124
req := csi.GetCapacityRequest{}
125125
resp, err := cs.GetCapacity(context.Background(), &req)
126126
assert.Nil(t, resp)
127-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
127+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "GetCapacity is not yet implemented")) {
128128
t.Errorf("Unexpected error: %v", err)
129129
}
130130
}
@@ -135,7 +135,7 @@ func TestListVolumes(t *testing.T) {
135135
req := csi.ListVolumesRequest{}
136136
resp, err := cs.ListVolumes(context.Background(), &req)
137137
assert.Nil(t, resp)
138-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
138+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ListVolumes is not yet implemented")) {
139139
t.Errorf("Unexpected error: %v", err)
140140
}
141141
}
@@ -146,7 +146,7 @@ func TestCreateSnapshot(t *testing.T) {
146146
req := csi.CreateSnapshotRequest{}
147147
resp, err := cs.CreateSnapshot(context.Background(), &req)
148148
assert.Nil(t, resp)
149-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
149+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "CreateSnapshot is not yet implemented")) {
150150
t.Errorf("Unexpected error: %v", err)
151151
}
152152
}
@@ -157,7 +157,7 @@ func TestDeleteSnapshot(t *testing.T) {
157157
req := csi.DeleteSnapshotRequest{}
158158
resp, err := cs.DeleteSnapshot(context.Background(), &req)
159159
assert.Nil(t, resp)
160-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
160+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "DeleteSnapshot is not yet implemented")) {
161161
t.Errorf("Unexpected error: %v", err)
162162
}
163163
}
@@ -168,7 +168,7 @@ func TestListSnapshots(t *testing.T) {
168168
req := csi.ListSnapshotsRequest{}
169169
resp, err := cs.ListSnapshots(context.Background(), &req)
170170
assert.Nil(t, resp)
171-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
171+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ListSnapshots is not yet implemented")) {
172172
t.Errorf("Unexpected error: %v", err)
173173
}
174174
}
@@ -179,7 +179,7 @@ func TestControllerExpandVolume(t *testing.T) {
179179
req := csi.ControllerExpandVolumeRequest{}
180180
resp, err := cs.ControllerExpandVolume(context.Background(), &req)
181181
assert.Nil(t, resp)
182-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
182+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ControllerExpandVolume is not yet implemented")) {
183183
t.Errorf("Unexpected error: %v", err)
184184
}
185185
}
@@ -190,7 +190,7 @@ func TestControllerGetVolume(t *testing.T) {
190190
req := csi.ControllerGetVolumeRequest{}
191191
resp, err := cs.ControllerGetVolume(context.Background(), &req)
192192
assert.Nil(t, resp)
193-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
193+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "ControllerGetVolume is not yet implemented")) {
194194
t.Errorf("Unexpected error: %v", err)
195195
}
196196
}

pkg/csi-common/nodeserver-default.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,25 @@ func (ns *DefaultNodeServer) NodeGetCapabilities(ctx context.Context, req *csi.N
4040
}
4141

4242
func (ns *DefaultNodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) {
43-
return nil, status.Error(codes.Unimplemented, "")
43+
return nil, status.Error(codes.Unimplemented, "NodeStageVolume is not yet implemented")
4444
}
4545

4646
func (ns *DefaultNodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) {
47-
return nil, status.Error(codes.Unimplemented, "")
47+
return nil, status.Error(codes.Unimplemented, "NodeUnstageVolume is not yet implemented")
4848
}
4949

5050
func (ns *DefaultNodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
51-
return nil, status.Error(codes.Unimplemented, "")
51+
return nil, status.Error(codes.Unimplemented, "NodePublishVolume is not yet implemented")
5252
}
5353

5454
func (ns *DefaultNodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) {
55-
return nil, status.Error(codes.Unimplemented, "")
55+
return nil, status.Error(codes.Unimplemented, "NodeUnpublishVolume is not yet implemented")
5656
}
5757

5858
func (ns *DefaultNodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) {
59-
return nil, status.Error(codes.Unimplemented, "")
59+
return nil, status.Error(codes.Unimplemented, "NodeGetVolumeStats is not yet implemented")
6060
}
6161

6262
func (ns *DefaultNodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
63-
return nil, status.Error(codes.Unimplemented, "")
63+
return nil, status.Error(codes.Unimplemented, "NodeExpandVolume is not yet implemented")
6464
}

pkg/csi-common/nodeserver-default_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func TestNodeStageVolume(t *testing.T) {
5656
req := csi.NodeStageVolumeRequest{}
5757
resp, err := ns.NodeStageVolume(context.Background(), &req)
5858
assert.Nil(t, resp)
59-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
59+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "NodeStageVolume is not yet implemented")) {
6060
t.Errorf("Unexpected error: %v", err)
6161
}
6262
}
@@ -67,7 +67,7 @@ func TestNodeUnstageVolume(t *testing.T) {
6767
req := csi.NodeUnstageVolumeRequest{}
6868
resp, err := ns.NodeUnstageVolume(context.Background(), &req)
6969
assert.Nil(t, resp)
70-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
70+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "NodeUnstageVolume is not yet implemented")) {
7171
t.Errorf("Unexpected error: %v", err)
7272
}
7373
}
@@ -78,7 +78,7 @@ func TestNodePublishVolume(t *testing.T) {
7878
req := csi.NodePublishVolumeRequest{}
7979
resp, err := ns.NodePublishVolume(context.Background(), &req)
8080
assert.Nil(t, resp)
81-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
81+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "NodePublishVolume is not yet implemented")) {
8282
t.Errorf("Unexpected error: %v", err)
8383
}
8484
}
@@ -89,7 +89,7 @@ func TestNodeUnpublishVolume(t *testing.T) {
8989
req := csi.NodeUnpublishVolumeRequest{}
9090
resp, err := ns.NodeUnpublishVolume(context.Background(), &req)
9191
assert.Nil(t, resp)
92-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
92+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "NodeUnpublishVolume is not yet implemented")) {
9393
t.Errorf("Unexpected error: %v", err)
9494
}
9595
}
@@ -100,7 +100,7 @@ func TestNodeGetVolumeStats(t *testing.T) {
100100
req := csi.NodeGetVolumeStatsRequest{}
101101
resp, err := ns.NodeGetVolumeStats(context.Background(), &req)
102102
assert.Nil(t, resp)
103-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
103+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "NodeGetVolumeStats is not yet implemented")) {
104104
t.Errorf("Unexpected error: %v", err)
105105
}
106106
}
@@ -111,7 +111,7 @@ func TestNodeExpandVolume(t *testing.T) {
111111
req := csi.NodeExpandVolumeRequest{}
112112
resp, err := ns.NodeExpandVolume(context.Background(), &req)
113113
assert.Nil(t, resp)
114-
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "")) {
114+
if !reflect.DeepEqual(err, status.Error(codes.Unimplemented, "NodeExpandVolume is not yet implemented")) {
115115
t.Errorf("Unexpected error: %v", err)
116116
}
117117
}

0 commit comments

Comments
 (0)