Skip to content

Commit ee159a2

Browse files
committed
[squash] return an error on StatsFS
1 parent 20b55a6 commit ee159a2

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Diff for: pkg/mount-manager/statter_windows.go

+3-10
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,13 @@ func (r *realStatter) StatFS(path string) (available, capacity, used, inodesFree
4848
return r.StatFSV1Beta(path)
4949
}
5050

51-
return 1, 1, 1, 1, 1, 1, nil
51+
return 1, 1, 1, 1, 1, 1, fmt.Errorf("Invalid interface type=%v", r.mounter.Interface)
5252
}
5353

5454
func (r *realStatter) StatFSV1(path string) (available, capacity, used, inodesFree, inodes, inodesUsed int64, err error) {
5555
zero := int64(0)
5656

57-
proxy, ok := r.mounter.Interface.(*CSIProxyMounterV1)
58-
if !ok {
59-
return zero, zero, zero, zero, zero, zero, fmt.Errorf("could not cast to csi proxy class")
60-
}
61-
57+
proxy := r.mounter.Interface.(*CSIProxyMounterV1)
6258
idRequest := &volumeapiv1.VolumeIDFromMountRequest{
6359
Mount: path,
6460
}
@@ -84,10 +80,7 @@ func (r *realStatter) StatFSV1(path string) (available, capacity, used, inodesFr
8480
func (r *realStatter) StatFSV1Beta(path string) (available, capacity, used, inodesFree, inodes, inodesUsed int64, err error) {
8581
zero := int64(0)
8682

87-
proxy, ok := r.mounter.Interface.(*CSIProxyMounterV1Beta)
88-
if !ok {
89-
return zero, zero, zero, zero, zero, zero, fmt.Errorf("could not cast to csi proxy class")
90-
}
83+
proxy := r.mounter.Interface.(*CSIProxyMounterV1Beta)
9184

9285
idRequest := &volumeapiv1beta1.VolumeIDFromMountRequest{
9386
Mount: path,

0 commit comments

Comments
 (0)