mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 16:35:44 +03:00
Skip non-regular files in embedding and comment on the chrootEnv map
This commit is contained in:
@@ -144,10 +144,9 @@ func (d *AllocDir) Embed(task string, dirs map[string]string) error {
|
||||
subdirs[hostEntry] = filepath.Join(dest, filepath.Base(hostEntry))
|
||||
continue
|
||||
} else if !entry.Mode().IsRegular() {
|
||||
// If it is a symlink we can create it, otherwise it is an
|
||||
// error.
|
||||
// If it is a symlink we can create it, otherwise we skip it.
|
||||
if entry.Mode()&os.ModeSymlink == 0 {
|
||||
return fmt.Errorf("Can't embed non-regular file (%v): %v", entry.Mode().String(), hostEntry)
|
||||
continue
|
||||
}
|
||||
|
||||
link, err := os.Readlink(hostEntry)
|
||||
|
||||
@@ -29,6 +29,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
// A mapping of directories on the host OS to attempt to embed inside each
|
||||
// task's chroot.
|
||||
chrootEnv = map[string]string{
|
||||
"/bin": "/bin",
|
||||
"/etc": "/etc",
|
||||
|
||||
Reference in New Issue
Block a user