diff --git a/common/docker/client.go b/common/docker/client.go index cb68c94f..381c887d 100644 --- a/common/docker/client.go +++ b/common/docker/client.go @@ -231,7 +231,7 @@ func (c *Client) EnsureNetwork(networkName, driver, subnet string, options map[s Name: networkName, CheckDuplicate: true, Driver: driver, - IPAM: docker.IPAMOptions{ + IPAM: &docker.IPAMOptions{ Driver: driver, Config: []docker.IPAMConfig{{Subnet: subnet}}, }, diff --git a/ipam/http_test.go b/ipam/http_test.go index c371949b..1849ebb8 100644 --- a/ipam/http_test.go +++ b/ipam/http_test.go @@ -132,7 +132,7 @@ func TestBadHttp(t *testing.T) { // Verb that's not handled resp, err := doHTTP("HEAD", fmt.Sprintf("http://localhost:%d/ip/%s/%s", port, containerID, testAddr1)) require.NoError(t, err) - require.Equal(t, http.StatusNotFound, resp.StatusCode, "http response") + require.Equal(t, http.StatusMethodNotAllowed, resp.StatusCode, "http response") // Mis-spelled URL resp, err = doHTTP("POST", fmt.Sprintf("http://localhost:%d/xip/%s/", port, containerID)) require.NoError(t, err) diff --git a/plugin/ipam/driver.go b/plugin/ipam/driver.go index ceb9458b..4057b3d7 100644 --- a/plugin/ipam/driver.go +++ b/plugin/ipam/driver.go @@ -110,6 +110,10 @@ func (i *Ipam) ReleaseAddress(poolID string, address net.IP) error { return i.weave.ReleaseIPsFor(address.String()) } +func (i *Ipam) IsBuiltIn() bool { + return false +} + // Functions required by ipamapi "contract" but not actually used. func (i *Ipam) DiscoverNew(discoverapi.DiscoveryType, interface{}) error { diff --git a/prog/weaveutil/plugin_network.go b/prog/weaveutil/plugin_network.go index f3a4a272..346197f2 100644 --- a/prog/weaveutil/plugin_network.go +++ b/prog/weaveutil/plugin_network.go @@ -6,6 +6,7 @@ import ( "fmt" "strings" + "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" docker "github.com/fsouza/go-dockerclient" ) @@ -58,7 +59,7 @@ func isDockerPluginEnabled(args []string) error { ctx := context.Background() - plugins, err := c.PluginList(ctx) + plugins, err := c.PluginList(ctx, filters.Args{}) if err != nil { return err } diff --git a/test/tls/generate_certs.go b/test/tls/generate_certs.go index 6e2a1b1d..319384ad 100644 --- a/test/tls/generate_certs.go +++ b/test/tls/generate_certs.go @@ -41,15 +41,15 @@ func main() { log.Fatalf("The client key already exists. Please remove it or specify a different key/cert.") } - err = cert.GenerateCert( - []string{""}, - clientCertPath, - clientKeyPath, - caCertPath, - caKeyPath, - org, - bits, - ) + err = cert.GenerateCert(&cert.Options{ + Hosts: []string{""}, + CertFile: clientCertPath, + KeyFile: clientKeyPath, + CAFile: caCertPath, + CAKeyFile: caKeyPath, + Org: org, + Bits: bits, + }) if err != nil { log.Fatalf("Error generating client certificate: %s", err) } @@ -64,15 +64,15 @@ func main() { if _, err := os.Stat(serverCertPath); os.IsNotExist(err) { log.Printf("Creating server certificate: %s", serverCertPath) - err = cert.GenerateCert( - []string{ip}, - serverCertPath, - serverKeyPath, - caCertPath, - caKeyPath, - org, - bits, - ) + err = cert.GenerateCert(&cert.Options{ + Hosts: []string{ip}, + CertFile: serverCertPath, + KeyFile: serverKeyPath, + CAFile: caCertPath, + CAKeyFile: caKeyPath, + Org: org, + Bits: bits, + }) if err != nil { log.Fatalf("error generating server cert: %s", err) }