[ARVADOS] updated: fbacdaec3dbba425155ab6348c7e6b80ff4e710b
Git user
git at public.curoverse.com
Wed Jan 25 18:05:25 EST 2017
Summary of changes:
services/crunch-run/crunchrun.go | 6 ++++++
services/crunch-run/crunchrun_test.go | 21 +++++++++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
via fbacdaec3dbba425155ab6348c7e6b80ff4e710b (commit)
from edd77406c5a428af8780ed4dffd512adcc70bc0f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit fbacdaec3dbba425155ab6348c7e6b80ff4e710b
Author: radhika <radhika at curoverse.com>
Date: Sat Jan 21 19:05:55 2017 -0500
9397: only mount points of kind "collection" are allowed under the output_dir.
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index 0eb5939..dfe2dfa 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -290,6 +290,12 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
needCertMount = false
}
+ if strings.HasPrefix(bind, runner.Container.OutputPath+"/") && bind != runner.Container.OutputPath+"/" {
+ if mnt.Kind != "collection" {
+ return fmt.Errorf("Only mount points of kind 'collection' are supported underneath the output_path: %v", bind)
+ }
+ }
+
switch {
case mnt.Kind == "collection":
var src string
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index af531f8..1cbaa6c 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -919,7 +919,7 @@ func (s *TestSuite) TestSetupMounts(c *C) {
checkEmpty()
}
- // read-only mount points are allowed underneath output_dir mount point
+ // Read-only mount points are allowed underneath output_dir mount point
{
i = 0
cr.Container.Mounts = make(map[string]arvados.Mount)
@@ -939,7 +939,7 @@ func (s *TestSuite) TestSetupMounts(c *C) {
checkEmpty()
}
- // writable mount points are not allowed underneath output_dir mount point
+ // Writable mount points are not allowed underneath output_dir mount point
{
i = 0
cr.Container.Mounts = make(map[string]arvados.Mount)
@@ -955,6 +955,23 @@ func (s *TestSuite) TestSetupMounts(c *C) {
cr.CleanupDirs()
checkEmpty()
}
+
+ // Only mount points of kind 'collection' are allowed underneath output_dir mount point
+ {
+ i = 0
+ cr.Container.Mounts = make(map[string]arvados.Mount)
+ cr.Container.Mounts = map[string]arvados.Mount{
+ "/tmp": {Kind: "tmp"},
+ "/tmp/foo": {Kind: "json"},
+ }
+ cr.OutputPath = "/tmp"
+
+ err := cr.SetupMounts()
+ c.Check(err, NotNil)
+ c.Check(err, ErrorMatches, `Only mount points of kind 'collection' are supported underneath the output_path.*`)
+ cr.CleanupDirs()
+ checkEmpty()
+ }
}
func (s *TestSuite) TestStdout(c *C) {
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list