Skip to content

Commit 2f7be63

Browse files
authored
Merge pull request #641 from jingxu97/oct/fstype
Add fstype check for Windows
2 parents 929d795 + 6bf1ce6 commit 2f7be63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/gce-pd-csi-driver/utils_windows.go

+4
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ package gceGCEDriver
1717

1818
import (
1919
"fmt"
20+
"strings"
2021

2122
"k8s.io/utils/mount"
2223
"sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common"
2324
mounter "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/mount-manager"
2425
)
2526

2627
func formatAndMount(source, target, fstype string, options []string, m *mount.SafeFormatAndMount) error {
28+
if !strings.EqualFold(fstype, defaultWindowsFsType) {
29+
return fmt.Errorf("GCE PD CSI driver can only supports %s file system, it does not support %s", defaultWindowsFsType, fstype)
30+
}
2731
proxy, ok := m.Interface.(*mounter.CSIProxyMounter)
2832
if !ok {
2933
return fmt.Errorf("could not cast to csi proxy class")

0 commit comments

Comments
 (0)