diff --git a/libnetwork/controller.go b/libnetwork/controller.go index b3b782f4d4..0041c9ef84 100644 --- a/libnetwork/controller.go +++ b/libnetwork/controller.go @@ -374,7 +374,7 @@ func (c *Controller) BuiltinDrivers() []string { // BuiltinIPAMDrivers returns the list of builtin ipam drivers. func (c *Controller) BuiltinIPAMDrivers() []string { drivers := []string{} - c.ipamRegistry.WalkIPAMs(func(name string, driver ipamapi.Ipam, cap *ipamapi.Capability) bool { + c.ipamRegistry.WalkIPAMs(func(name string, driver ipamapi.Ipam, _ *ipamapi.Capability) bool { if driver.IsBuiltIn() { drivers = append(drivers, name) } @@ -392,14 +392,14 @@ func (c *Controller) processNodeDiscovery(nodes []net.IP, add bool) { }) } -func (c *Controller) pushNodeDiscovery(d discoverapi.Discover, cap driverapi.Capability, nodes []net.IP, add bool) { +func (c *Controller) pushNodeDiscovery(d discoverapi.Discover, capability driverapi.Capability, nodes []net.IP, add bool) { var self net.IP // try swarm-mode config if agent := c.getAgent(); agent != nil { self = net.ParseIP(agent.advertiseAddr) } - if d == nil || cap.ConnectivityScope != scope.Global || nodes == nil { + if d == nil || capability.ConnectivityScope != scope.Global || nodes == nil { return } @@ -1095,7 +1095,7 @@ func (c *Controller) loadIPAMDriver(name string) error { } func (c *Controller) getIPAMDriver(name string) (ipamapi.Ipam, *ipamapi.Capability, error) { - id, cap := c.ipamRegistry.IPAM(name) + id, caps := c.ipamRegistry.IPAM(name) if id == nil { // Might be a plugin name. Try loading it if err := c.loadIPAMDriver(name); err != nil { @@ -1103,13 +1103,13 @@ func (c *Controller) getIPAMDriver(name string) (ipamapi.Ipam, *ipamapi.Capabili } // Now that we resolved the plugin, try again looking up the registry - id, cap = c.ipamRegistry.IPAM(name) + id, caps = c.ipamRegistry.IPAM(name) if id == nil { return nil, nil, types.BadRequestErrorf("invalid ipam driver: %q", name) } } - return id, cap, nil + return id, caps, nil } // Stop stops the network controller. diff --git a/libnetwork/drvregistry/ipams_test.go b/libnetwork/drvregistry/ipams_test.go index f23561cd49..6c0ec37685 100644 --- a/libnetwork/drvregistry/ipams_test.go +++ b/libnetwork/drvregistry/ipams_test.go @@ -27,9 +27,9 @@ func TestIPAMs(t *testing.T) { t.Run("IPAM", func(t *testing.T) { reg := getNewIPAMs(t) - i, cap := reg.IPAM("default") + i, caps := reg.IPAM("default") assert.Check(t, i != nil) - assert.Check(t, cap != nil) + assert.Check(t, caps != nil) }) t.Run("WalkIPAMs", func(t *testing.T) {