open-nomad/client/allocdir/fs_windows.go

78 lines
2 KiB
Go
Raw Normal View History

package allocdir
import (
2016-09-02 00:23:15 +00:00
"errors"
"os"
2016-06-19 20:56:09 +00:00
"path/filepath"
)
var (
// SharedAllocContainerPath is the path inside container for mounted
// directory shared across tasks in a task group.
2016-06-19 20:56:09 +00:00
SharedAllocContainerPath = filepath.Join("c:\\", SharedAllocName)
// TaskLocalContainer is the path inside a container for mounted directory
// for local storage.
2016-06-19 20:56:09 +00:00
TaskLocalContainerPath = filepath.Join("c:\\", TaskLocal)
// TaskSecretsContainerPath is the path inside a container for mounted
// secrets directory
TaskSecretsContainerPath = filepath.Join("c:\\", TaskSecrets)
)
// linkOrCopy is always copies dst to src on Windows.
func linkOrCopy(src, dst string, uid, gid int, perm os.FileMode) error {
return fileCopy(src, dst, uid, gid, perm)
}
2016-09-02 00:23:15 +00:00
// The windows version does nothing currently.
func mountSharedDir(dir string) error {
2016-09-02 00:23:15 +00:00
return errors.New("Mount on Windows not supported.")
}
2015-09-25 23:49:14 +00:00
// The windows version does nothing currently.
func linkDir(src, dst string) error {
return nil
}
// The windows version does nothing currently.
func unlinkDir(dir string) error {
return nil
}
// createSecretDir creates the secrets dir folder at the given path
func createSecretDir(dir string) error {
return os.MkdirAll(dir, 0777)
}
// removeSecretDir removes the secrets dir folder
func removeSecretDir(dir string) error {
return os.RemoveAll(dir)
}
2016-09-02 00:23:15 +00:00
// The windows version does nothing currently.
func dropDirPermissions(path string, desired os.FileMode) error {
2016-09-02 00:23:15 +00:00
return nil
2015-09-25 23:49:14 +00:00
}
// The windows version does nothing currently.
func unmountSharedDir(dir string) error {
return nil
2015-09-25 23:49:14 +00:00
}
// MountSpecialDirs mounts the dev and proc file system on the chroot of the
// task. It's a no-op on windows.
func MountSpecialDirs(taskDir string) error {
return nil
}
// unmountSpecialDirs unmounts the dev and proc file system from the chroot
func unmountSpecialDirs(taskDir string) error {
return nil
}
// getOwner doesn't work on Windows as Windows doesn't use int user IDs
func getOwner(os.FileInfo) (int, int) {
return idUnsupported, idUnsupported
}