diff --git a/README.md b/README.md index 76acda6..e75ac39 100755 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ If you want to use Nutanix Node Driver, you need add it in order to start using 2. Click *Add Node Driver*. 3. Complete the Add Node Driver form. Then click Create. - - *Download URL*: `https://github.com/nutanix/docker-machine/releases/download/v3.0.0/docker-machine-driver-nutanix_v3.0.0_linux` + - *Download URL*: `https://github.com/nutanix/docker-machine/releases/download/v3.0.1/docker-machine-driver-nutanix_v3.0.1_linux` - *Custom UI URL*: `https://nutanix.github.io/rancher-ui-driver/v3.0.0/component.js` - *Whitelist Domains*: `nutanix.github.io` diff --git a/machine/driver/driver.go b/machine/driver/driver.go index 9b18cde..1fbb830 100755 --- a/machine/driver/driver.go +++ b/machine/driver/driver.go @@ -6,6 +6,7 @@ import ( "fmt" "io/ioutil" "net" + "net/url" "strings" "time" @@ -101,7 +102,9 @@ func (d *NutanixDriver) Create() error { } // Search target cluster - clusterFilter := fmt.Sprintf("name==%s", d.Cluster) + c := &url.URL{Path: d.Cluster} + encodedCluster := c.String() + clusterFilter := fmt.Sprintf("name==%s", encodedCluster) clusters, err := conn.V3.ListAllCluster(clusterFilter) if err != nil { log.Errorf("Error getting clusters: [%v]", err) @@ -131,7 +134,9 @@ func (d *NutanixDriver) Create() error { subnetFilter += "," } - subnetFilter += fmt.Sprintf("name==%s", subnet) + t := &url.URL{Path: subnet} + encodedSubnet := t.String() + subnetFilter += fmt.Sprintf("name==%s", encodedSubnet) } subnets, err := conn.V3.ListAllSubnet(subnetFilter) @@ -181,7 +186,9 @@ func (d *NutanixDriver) Create() error { } // Search image template - imageFilter := fmt.Sprintf("name==%s", d.Image) + i := &url.URL{Path: d.Image} + encodedImage := i.String() + imageFilter := fmt.Sprintf("name==%s", encodedImage) images, err := conn.V3.ListAllImage(imageFilter) if err != nil { log.Errorf("Error getting images: [%v]", err)