Merge branch 'fix-cli' into 'master'

need to use >=17.05 (not 17.5), add trimming for weird builds

See merge request !43
This commit is contained in:
Travis Reeder
2017-06-07 15:48:00 -07:00

View File

@@ -10,6 +10,7 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"strings" "strings"
"unicode"
"github.com/coreos/go-semver/semver" "github.com/coreos/go-semver/semver"
@@ -130,7 +131,10 @@ func dockerVersionCheck() error {
if err != nil { if err != nil {
return fmt.Errorf("could not check Docker version: %v", err) return fmt.Errorf("could not check Docker version: %v", err)
} }
v, err := semver.NewVersion(string(out)) // dev / test builds append '-ce', trim this
trimmed := strings.TrimRightFunc(string(out), func(r rune) bool { return r != '.' && !unicode.IsDigit(r) })
v, err := semver.NewVersion(trimmed)
if err != nil { if err != nil {
return fmt.Errorf("could not check Docker version: %v", err) return fmt.Errorf("could not check Docker version: %v", err)
} }