github.com/manicqin/nomad@v0.9.5/client/allocdir/fs_android.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("/", SharedAllocName) 12 13 // TaskLocalContainer is the path inside a container for mounted directory 14 // for local storage. 15 TaskLocalContainerPath = filepath.Join("/", TaskLocal) 16 17 // TaskSecretsContainerPath is the path inside a container for mounted 18 // secrets directory 19 TaskSecretsContainerPath = filepath.Join("/", TaskSecrets) 20 ) 21 22 // The android version always copies src to dst 23 // hardlink fails. 24 func linkOrCopy(src, dst string, uid, gid int, perm os.FileMode) error { 25 return fileCopy(src, dst, uid, gid, perm) 26 } 27 28 // The windows version does nothing currently. 29 func linkDir(src, dst string) error { 30 return nil 31 } 32 33 // The windows version does nothing currently. 34 func unlinkDir(dir string) error { 35 return nil 36 } 37 38 // createSecretDir creates the secrets dir folder at the given path 39 func createSecretDir(dir string) error { 40 return os.MkdirAll(dir, 0777) 41 } 42 43 // removeSecretDir removes the secrets dir folder 44 func removeSecretDir(dir string) error { 45 return os.RemoveAll(dir) 46 } 47 48 // The android version does nothing currently. 49 func dropDirPermissions(path string, desired os.FileMode) error { 50 return nil 51 } 52 53 // MountSpecialDirs mounts the dev and proc file system on the chroot of the 54 // task. It's a no-op on android. 55 func MountSpecialDirs(taskDir string) error { 56 return nil 57 } 58 59 // unmountSpecialDirs unmounts the dev and proc file system from the chroot 60 func unmountSpecialDirs(taskDir string) error { 61 return nil 62 } 63 64 // getOwner is irrelevant in android as users 65 func getOwner(os.FileInfo) (int, int) { 66 return idUnsupported, idUnsupported 67 }