Permalink
Browse files

Fixed incorrect parsing of Boot2Docker ISO version (issue #4058).

Signed-off-by: Guillaume Grussenmeyer <ggrussenmeyer@gmail.com>
  • Loading branch information...
ggrussenmeyer authored and shin- committed Sep 1, 2017
1 parent 89038b0 commit 4766108f8726baeafd559a89293cc16959f8bedc
Showing with 5 additions and 3 deletions.
  1. +4 −2 libmachine/mcnutils/b2d.go
  2. +1 −1 version/version.go
@@ -307,14 +307,16 @@ func (b *b2dISO) version() (string, error) {
fullVersion := string(isoMetadata)
versionIndex := strings.Index(fullVersion, versionPrefix)
trimmedVersion := strings.TrimSpace( fullVersion )
versionIndex := strings.Index(trimmedVersion, versionPrefix)
if versionIndex == -1 {
return "", fmt.Errorf("Did not find prefix %q in version string", versionPrefix)
}
// Original magic file string looks similar to this: "Boot2Docker-v0.1.0 "
// This will return "v0.1.0" given the above string
vers := strings.TrimSpace(fullVersion)[versionIndex+1:]
vers := trimmedVersion[versionIndex+1:]
log.Debug("local Boot2Docker ISO version: ", vers)
return vers, nil
View
@@ -6,7 +6,7 @@ import (
)
var (
Version = "0.12.2"
Version = "dev"
// GitCommit will be overwritten automatically by the build system
GitCommit = "HEAD"

0 comments on commit 4766108

Please sign in to comment.