diff --git a/ipam/plugin.go b/ipam/plugin.go index 4e04943ae..94be9848f 100644 --- a/ipam/plugin.go +++ b/ipam/plugin.go @@ -26,7 +26,6 @@ type ipamPlugin struct { type IpamPlugin interface { Start(chan error) error Stop() - GetListener() *core.Listener } // Creates a new IpamPlugin object. @@ -80,11 +79,6 @@ func (plugin *ipamPlugin) Stop() { log.Printf("%s: Plugin stopped.\n", plugin.name) } -// Returns the listener for the plugin. -func (plugin *ipamPlugin) GetListener() *core.Listener { - return plugin.listener -} - type activateResponse struct { Implements []string } diff --git a/ipam/plugin_test.go b/ipam/plugin_test.go index 5fde60e2b..ea2f4c05f 100644 --- a/ipam/plugin_test.go +++ b/ipam/plugin_test.go @@ -33,7 +33,8 @@ func TestMain(m *testing.M) { return } - mux = plugin.GetListener().GetMux() + // Get the internal http mux as test hook. + mux = plugin.(*ipamPlugin).listener.GetMux() // Run tests. exitCode := m.Run() diff --git a/network/plugin.go b/network/plugin.go index 01ab4ed3c..64aebb6f8 100644 --- a/network/plugin.go +++ b/network/plugin.go @@ -28,7 +28,6 @@ type netPlugin struct { type NetPlugin interface { Start(chan error) error Stop() - GetListener() *core.Listener } // Creates a new NetPlugin object. @@ -85,11 +84,6 @@ func (plugin *netPlugin) Stop() { log.Printf("%s: Plugin stopped.\n", plugin.name) } -// Returns the listener for the plugin. -func (plugin *netPlugin) GetListener() *core.Listener { - return plugin.listener -} - func (plugin *netPlugin) networkExists(networkID string) bool { if plugin.networks[networkID] != nil { return true diff --git a/network/plugin_test.go b/network/plugin_test.go index 1b5d0118b..8f9bcfc2b 100644 --- a/network/plugin_test.go +++ b/network/plugin_test.go @@ -35,7 +35,8 @@ func TestMain(m *testing.M) { return } - mux = plugin.GetListener().GetMux() + // Get the internal http mux as test hook. + mux = plugin.(*netPlugin).listener.GetMux() // Run tests. exitCode := m.Run()