X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2f66d4cc05e9442a9bb69969744d0750a02a1ed4..13116cc7dc549e93b0757f1948c2ac18b760c681:/lib/crunchrun/copier.go diff --git a/lib/crunchrun/copier.go b/lib/crunchrun/copier.go index b1497277f2..72c714dfa4 100644 --- a/lib/crunchrun/copier.go +++ b/lib/crunchrun/copier.go @@ -55,7 +55,7 @@ type copier struct { keepClient IKeepClient hostOutputDir string ctrOutputDir string - binds []string + bindmounts map[string]bindmount mounts map[string]arvados.Mount secretMounts map[string]arvados.Mount logger printfer @@ -195,9 +195,8 @@ func (cp *copier) walkMount(dest, src string, maxSymlinks int, walkMountsBelow b } if walkMountsBelow { return cp.walkMountsBelow(dest, src) - } else { - return nil } + return nil } func (cp *copier) walkMountsBelow(dest, src string) error { @@ -332,8 +331,8 @@ func (cp *copier) walkHostFS(dest, src string, maxSymlinks int, includeMounts bo }) return nil } - - return fmt.Errorf("Unsupported file type (mode %o) in output dir: %q", fi.Mode(), src) + cp.logger.Printf("Skipping unsupported file type (mode %o) in output dir: %q", fi.Mode(), src) + return nil } // Return the host path that was mounted at the given path in the @@ -342,11 +341,8 @@ func (cp *copier) hostRoot(ctrRoot string) (string, error) { if ctrRoot == cp.ctrOutputDir { return cp.hostOutputDir, nil } - for _, bind := range cp.binds { - tokens := strings.Split(bind, ":") - if len(tokens) >= 2 && tokens[1] == ctrRoot { - return tokens[0], nil - } + if mnt, ok := cp.bindmounts[ctrRoot]; ok { + return mnt.HostPath, nil } return "", fmt.Errorf("not bind-mounted: %q", ctrRoot) }