github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/client/allocdir/fs_windows.go (about)

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