summaryrefslogtreecommitdiffhomepage
path: root/runsc/dockerutil
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-02-05 22:45:44 -0800
committergVisor bot <gvisor-bot@google.com>2020-02-05 22:46:35 -0800
commit1b6a12a768216a99a5e0428c42ea4faf79cf3b50 (patch)
tree995d1ae4ba930d3c6b8fde0f3d1651db472c0dba /runsc/dockerutil
parentf3d95607036b8a502c65aa7b3e8145227274dbbc (diff)
Add notes to relevant tests.
These were out-of-band notes that can help provide additional context and simplify automated imports. PiperOrigin-RevId: 293525915
Diffstat (limited to 'runsc/dockerutil')
-rw-r--r--runsc/dockerutil/dockerutil.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/runsc/dockerutil/dockerutil.go b/runsc/dockerutil/dockerutil.go
index 9b6346ca2..1ff5e8cc3 100644
--- a/runsc/dockerutil/dockerutil.go
+++ b/runsc/dockerutil/dockerutil.go
@@ -143,8 +143,11 @@ func PrepareFiles(names ...string) (string, error) {
return "", fmt.Errorf("os.Chmod(%q, 0777) failed: %v", dir, err)
}
for _, name := range names {
- src := getLocalPath(name)
- dst := path.Join(dir, name)
+ src, err := testutil.FindFile(name)
+ if err != nil {
+ return "", fmt.Errorf("testutil.Preparefiles(%q) failed: %v", name, err)
+ }
+ dst := path.Join(dir, path.Base(name))
if err := testutil.Copy(src, dst); err != nil {
return "", fmt.Errorf("testutil.Copy(%q, %q) failed: %v", src, dst, err)
}
@@ -152,10 +155,6 @@ func PrepareFiles(names ...string) (string, error) {
return dir, nil
}
-func getLocalPath(file string) string {
- return path.Join(".", file)
-}
-
// do executes docker command.
func do(args ...string) (string, error) {
log.Printf("Running: docker %s\n", args)