github.com/hooklift/nomad@v0.5.7-0.20170407200202-db11e7dd7b55/client/allocdir/fs_windows.go (about)

     1  package allocdir
     2  
     3  import (
     4  	"errors"
     5  	"os"
     6  	"path/filepath"
     7  )
     8  
     9  var (
    10  	// SharedAllocContainerPath is the path inside container for mounted
    11  	// directory shared across tasks in a task group.
    12  	SharedAllocContainerPath = filepath.Join("c:\\", SharedAllocName)
    13  
    14  	// TaskLocalContainer is the path inside a container for mounted directory
    15  	// for local storage.
    16  	TaskLocalContainerPath = filepath.Join("c:\\", TaskLocal)
    17  
    18  	// TaskSecretsContainerPath is the path inside a container for mounted
    19  	// secrets directory
    20  	TaskSecretsContainerPath = filepath.Join("c:\\", TaskSecrets)
    21  )
    22  
    23  // linkOrCopy is always copies dst to src on Windows.
    24  func linkOrCopy(src, dst string, perm os.FileMode) error {
    25  	return fileCopy(src, dst, perm)
    26  }
    27  
    28  // The windows version does nothing currently.
    29  func mountSharedDir(dir string) error {
    30  	return errors.New("Mount on Windows not supported.")
    31  }
    32  
    33  // The windows version does nothing currently.
    34  func linkDir(src, dst string) error {
    35  	return nil
    36  }
    37  
    38  // The windows version does nothing currently.
    39  func unlinkDir(dir string) error {
    40  	return nil
    41  }
    42  
    43  // createSecretDir creates the secrets dir folder at the given path
    44  func createSecretDir(dir string) error {
    45  	return os.MkdirAll(dir, 0777)
    46  }
    47  
    48  // removeSecretDir removes the secrets dir folder
    49  func removeSecretDir(dir string) error {
    50  	return os.RemoveAll(dir)
    51  }
    52  
    53  // The windows version does nothing currently.
    54  func dropDirPermissions(path string) error {
    55  	return nil
    56  }
    57  
    58  // The windows version does nothing currently.
    59  func unmountSharedDir(dir string) error {
    60  	return nil
    61  }
    62  
    63  // MountSpecialDirs mounts the dev and proc file system on the chroot of the
    64  // task. It's a no-op on windows.
    65  func MountSpecialDirs(taskDir string) error {
    66  	return nil
    67  }
    68  
    69  // unmountSpecialDirs unmounts the dev and proc file system from the chroot
    70  func unmountSpecialDirs(taskDir string) error {
    71  	return nil
    72  }