Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
Removed creation of mount source directories
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoltzsche committed Feb 26, 2018
1 parent bc54cc9 commit 7f6c38b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions compose-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ services:
image: alpine:3.7
tty: true
volumes:
- "./build/testvol:/data"
- "./vendor.conf:/vendor.conf"
- "./build:/build"
- "./vendor.conf:/custom/vendor.conf"
- "/anon"
8 changes: 6 additions & 2 deletions oci/bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,19 @@ func createVolumeDirectories(spec *rspecs.Spec, dir string) (err error) {
if !filepath.IsAbs(src) {
src = filepath.Join(dir, src)
}
if _, err = os.Stat(src); os.IsNotExist(err) {
relsrc := filepath.Clean(mount.Source)
if _, err = os.Stat(src); os.IsNotExist(err) && !filepath.IsAbs(relsrc) && strings.Index(relsrc, "..") != 0 {
err = errors.Errorf("bind mount source %q does not exist", mount.Source)
if err = os.MkdirAll(src, 0755); err != nil {
break
}
} else if err != nil {
break
}
}
}
}
err = errors.Wrap(err, "create volume directories from spec")
err = errors.Wrap(err, "volume directories")
return
}

Expand Down

0 comments on commit 7f6c38b

Please sign in to comment.