Fix too many arguments

This commit is contained in:
bckr
2020-03-03 15:38:38 +01:00
parent 2a2bb0430e
commit 1549ed827a
2 changed files with 3 additions and 2 deletions

View File

@@ -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)

View File

@@ -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))