Secret dir, hello world

This commit is contained in:
Alex Dadgar
2016-08-29 15:35:14 -07:00
parent b813362ece
commit 0ebdff2bb7
12 changed files with 277 additions and 33 deletions

View File

@@ -9,17 +9,15 @@ import (
"github.com/hashicorp/go-multierror"
)
// Bind mounts the shared directory into the task directory. Must be root to
// run.
func (d *AllocDir) mountSharedDir(taskDir string) error {
if err := os.MkdirAll(taskDir, 0777); err != nil {
func (d *AllocDir) mount(src, dest string) error {
if err := os.MkdirAll(dest, 0777); err != nil {
return err
}
return syscall.Mount(d.SharedDir, taskDir, "", syscall.MS_BIND, "")
return syscall.Mount(src, dest, "", syscall.MS_BIND, "")
}
func (d *AllocDir) unmountSharedDir(dir string) error {
func (d *AllocDir) unmount(dir string) error {
return syscall.Unmount(dir, 0)
}