From ff7444ae02729a3b90b0501276acae8f6c3e3584 Mon Sep 17 00:00:00 2001 From: Justyn Temme Date: Thu, 19 Jul 2018 08:50:49 -0500 Subject: [PATCH] Update mount.go to allow relative file paths Signed-off-by: Justyn Temme --- opts/mount.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opts/mount.go b/opts/mount.go index 3aa9849421ac..309e89b6fd9f 100644 --- a/opts/mount.go +++ b/opts/mount.go @@ -4,6 +4,7 @@ import ( "encoding/csv" "fmt" "os" + "path/filepath" "strconv" "strings" @@ -88,7 +89,10 @@ func (m *MountOpt) Set(value string) error { case "type": mount.Type = mounttypes.Type(strings.ToLower(value)) case "source", "src": - mount.Source = value + mount.Source, err = filepath.Abs(value) + if err != nil { + mount.Source = value + } case "target", "dst", "destination": mount.Target = value case "readonly", "ro":