Skip to content

Commit 6bf1ce6

Browse files
committed
Add fstype for Windows
Add defensive check for Windows. GCE PD CSI driver only support ntfs for Windows. If other fstype is passed, return error.
1 parent 929d795 commit 6bf1ce6

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)