From a8473bd1ec9c96a2287b3f2fce2c827371c2129c Mon Sep 17 00:00:00 2001 From: Liping Xue Date: Wed, 6 Dec 2017 11:53:10 -0800 Subject: [PATCH 1/2] Fix a bug in required docker version check for vFile. --- client_plugin/drivers/vfile/dockerops/dockerops.go | 9 ++++++++- client_plugin/drivers/vfile/vfile_driver.go | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client_plugin/drivers/vfile/dockerops/dockerops.go b/client_plugin/drivers/vfile/dockerops/dockerops.go index ce22f4c86..d5707b470 100644 --- a/client_plugin/drivers/vfile/dockerops/dockerops.go +++ b/client_plugin/drivers/vfile/dockerops/dockerops.go @@ -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.Infof("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 diff --git a/client_plugin/drivers/vfile/vfile_driver.go b/client_plugin/drivers/vfile/vfile_driver.go index 8b66005d6..d3d4c86a0 100644 --- a/client_plugin/drivers/vfile/vfile_driver.go +++ b/client_plugin/drivers/vfile/vfile_driver.go @@ -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 From 4a9ea31cbc918a19427254f79c737404d4aae1f0 Mon Sep 17 00:00:00 2001 From: Liping Xue Date: Wed, 6 Dec 2017 13:28:52 -0800 Subject: [PATCH 2/2] Minor change. --- client_plugin/drivers/vfile/dockerops/dockerops.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client_plugin/drivers/vfile/dockerops/dockerops.go b/client_plugin/drivers/vfile/dockerops/dockerops.go index d5707b470..8b3877dd3 100644 --- a/client_plugin/drivers/vfile/dockerops/dockerops.go +++ b/client_plugin/drivers/vfile/dockerops/dockerops.go @@ -583,7 +583,7 @@ func (d *DockerOps) CheckDockerVersion(requiredVersion string) (bool, error) { versionStr := strings.Split(serverVersion.Version, "-") // dockerServersion only has the numeric part "17.06.0" dockerServerVersion := versionStr[0] - log.Infof("dockerServerVersion: %s", dockerServerVersion) + 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)