diff --git a/drivers/docker/driver.go b/drivers/docker/driver.go index bcee20b9c..dfdaeb5a9 100644 --- a/drivers/docker/driver.go +++ b/drivers/docker/driver.go @@ -636,7 +636,7 @@ func (d *Driver) containerBinds(task *drivers.TaskConfig, driverConfig *TaskConf // Otherwise, we assume we receive a relative path binding in the format // relative/to/task:/also/in/container if taskLocalBindVolume { - src = expandPath(task.TaskDir().Dir, src, runtime.GOOS) + src = expandPath(task.TaskDir().Dir, src) } else { // Resolve dotted path segments src = filepath.Clean(src) diff --git a/drivers/docker/utils.go b/drivers/docker/utils.go index ee31b9991..5692a54b6 100644 --- a/drivers/docker/utils.go +++ b/drivers/docker/utils.go @@ -7,6 +7,7 @@ import ( "os/exec" "path/filepath" "regexp" + "runtime" "strings" "github.com/docker/cli/cli/config/configfile" @@ -207,7 +208,7 @@ func validateCgroupPermission(s string) bool { // expandPath returns the absolute path of dir, relative to base if dir is relative path. // base is expected to be an absolute path func expandPath(base, dir string) string { - if os == "windows" { + if runtime.GOOS == "windows" { pipeExp := regexp.MustCompile(`^` + rxPipe + `$`) match := pipeExp.FindStringSubmatch(strings.ToLower(dir))