From 2dcfcf2b066c646f4854ba5231441b4f40f0a4a4 Mon Sep 17 00:00:00 2001 From: Fabio Rapposelli Date: Thu, 3 Dec 2015 07:24:26 -0500 Subject: [PATCH] Fix for vSphere driver boot2docker ISO issues Fixes #2279 #2060 Signed-off-by: Fabio Rapposelli --- drivers/vmwarevsphere/vc_conn.go | 4 ++-- drivers/vmwarevsphere/vsphere.go | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/vmwarevsphere/vc_conn.go b/drivers/vmwarevsphere/vc_conn.go index a18c7c27bc..3377ee4037 100644 --- a/drivers/vmwarevsphere/vc_conn.go +++ b/drivers/vmwarevsphere/vc_conn.go @@ -63,7 +63,7 @@ func (conn VcConn) DatastoreMkdir(dirName string) error { func (conn VcConn) DatastoreUpload(localPath, destination string) error { stdout, err := conn.DatastoreLs(destination) - if err == nil && strings.Contains(stdout, B2DISOName) { + if err == nil && strings.Contains(stdout, isoFilename) { log.Infof("boot2docker ISO already uploaded, skipping upload... ") return nil } @@ -71,7 +71,7 @@ func (conn VcConn) DatastoreUpload(localPath, destination string) error { log.Infof("Uploading %s to %s on datastore %s of vCenter %s... ", localPath, destination, conn.driver.Datastore, conn.driver.IP) - dsPath := fmt.Sprintf("%s/%s", destination, B2DISOName) + dsPath := fmt.Sprintf("%s/%s", destination, isoFilename) args := []string{"datastore.upload"} args = conn.AppendConnectionString(args) args = append(args, fmt.Sprintf("--ds=%s", conn.driver.Datastore)) diff --git a/drivers/vmwarevsphere/vsphere.go b/drivers/vmwarevsphere/vsphere.go index 3f114c226c..a8e8692dae 100644 --- a/drivers/vmwarevsphere/vsphere.go +++ b/drivers/vmwarevsphere/vsphere.go @@ -10,7 +10,6 @@ import ( "io/ioutil" "net" "os" - "path/filepath" "strings" "time" @@ -26,7 +25,6 @@ import ( const ( isoFilename = "boot2docker.iso" - B2DISOName = isoFilename B2DUser = "docker" B2DPass = "tcuser" ) @@ -172,7 +170,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error { d.SwarmHost = flags.String("swarm-host") d.SwarmDiscovery = flags.String("swarm-discovery") - d.ISO = filepath.Join(d.StorePath, isoFilename) + d.ISO = d.ResolveStorePath(isoFilename) return nil }