mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-18 16:21:13 +00:00
fix local volume issue on windows
This commit is contained in:
parent
c6c03477cf
commit
d3d3018860
@ -20,6 +20,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
@ -296,11 +297,13 @@ func (m *localVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if runtime.GOOS != "windows" {
|
||||||
|
// skip below MkdirAll for windows since the "bind mount" logic is implemented differently in mount_wiondows.go
|
||||||
if err := os.MkdirAll(dir, 0750); err != nil {
|
if err := os.MkdirAll(dir, 0750); err != nil {
|
||||||
glog.Errorf("mkdir failed on disk %s (%v)", dir, err)
|
glog.Errorf("mkdir failed on disk %s (%v)", dir, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Perform a bind mount to the full path to allow duplicate mounts of the same volume.
|
// Perform a bind mount to the full path to allow duplicate mounts of the same volume.
|
||||||
options := []string{"bind"}
|
options := []string{"bind"}
|
||||||
if m.readOnly {
|
if m.readOnly {
|
||||||
|
Loading…
Reference in New Issue
Block a user