Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Fix docker version check bug for vFile #2027

Merged
merged 2 commits into from
Dec 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion client_plugin/drivers/vfile/dockerops/dockerops.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,14 @@ func (d *DockerOps) CheckDockerVersion(requiredVersion string) (bool, error) {
log.Errorf("Failed to get docker server version. Error: %v", err)
return false, err
}
v1, err := version.NewVersion(serverVersion.Version)
// serverVersion.Version read from docker has the format like this
// 17.06.0-ce
// need to extract the numeric part to compare
versionStr := strings.Split(serverVersion.Version, "-")
// dockerServersion only has the numeric part "17.06.0"
dockerServerVersion := versionStr[0]
log.Debugf("dockerServerVersion: %s", dockerServerVersion)
v1, err := version.NewVersion(dockerServerVersion)
if err != nil {
log.Errorf("Failed to create version comparison for %s. Error: %v", serverVersion.Version, err)
return false, err
Expand Down
2 changes: 1 addition & 1 deletion client_plugin/drivers/vfile/vfile_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const (
initError = "vFile volume driver is not fully initialized yet."
mountError = "exit status 255"
checkTicker = time.Second
requiredVersion = "17.06"
requiredVersion = "17.06.0"
)

/* VolumeDriver - vFile plugin volume driver struct
Expand Down