Skip to content

Commit e1fa41d

Browse files
committed
chore: fix ut
1 parent 739696b commit e1fa41d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pkg/blob/nodeserver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ func (d *Driver) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeSta
552552
return nil, status.Errorf(codes.Internal, "%v", err)
553553
}
554554
if cache != nil {
555-
resp := cache.(csi.NodeGetVolumeStatsResponse)
555+
resp := cache.(*csi.NodeGetVolumeStatsResponse)
556556
klog.V(6).Infof("NodeGetVolumeStats: volume stats for volume %s path %s is cached", req.VolumeId, req.VolumePath)
557-
return &resp, nil
557+
return resp, nil
558558
}
559559

560560
mc := metrics.NewMetricContext(blobCSIDriverName, "node_get_volume_stats", d.cloud.ResourceGroup, "", d.Name)
@@ -624,7 +624,7 @@ func (d *Driver) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeSta
624624
isOperationSucceeded = true
625625
klog.V(6).Infof("NodeGetVolumeStats: volume stats for volume %s path %s is %v", req.VolumeId, req.VolumePath, resp)
626626
// cache the volume stats per volume
627-
d.volStatsCache.Set(req.VolumeId, *resp)
627+
d.volStatsCache.Set(req.VolumeId, resp)
628628
return resp, nil
629629
}
630630

pkg/blob/nodeserver_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ func TestNodePublishVolume(t *testing.T) {
248248
Exec: fakeExec,
249249
}
250250

251+
//nolint:govet
251252
for _, test := range tests {
252253
d.cloud.ResourceGroup = "rg"
253254
if test.setup != nil {
@@ -356,6 +357,7 @@ func TestNodeUnpublishVolume(t *testing.T) {
356357
Exec: fakeExec,
357358
}
358359

360+
//nolint:govet
359361
for _, test := range tests {
360362
if test.setup != nil {
361363
test.setup(d)
@@ -735,6 +737,7 @@ func TestNodeGetVolumeStats(t *testing.T) {
735737
_ = makeDir(fakePath)
736738
d := NewFakeDriver()
737739

740+
//nolint:govet
738741
for _, test := range tests {
739742
_, err := d.NodeGetVolumeStats(context.Background(), &test.req)
740743
//t.Errorf("[debug] error: %v\n metrics: %v", err, metrics)

0 commit comments

Comments
 (0)