daemon.getEndpointInNetwork() is only used on Windows

```
13:06:14 daemon/network.go:964:6: U1000: func `getEndpointInNetwork` is unused (unused)
13:06:14 func getEndpointInNetwork(name string, n libnetwork.Network) (libnetwork.Endpoint, error) {
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-08-05 15:47:29 +02:00
parent e334eeeed8
commit f6f58f3858
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 13 additions and 6 deletions

View File

@ -960,12 +960,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
return createOptions, nil
}
// getEndpointInNetwork returns the container's endpoint to the provided network.
func getEndpointInNetwork(name string, n libnetwork.Network) (libnetwork.Endpoint, error) {
endpointName := strings.TrimPrefix(name, "/")
return n.EndpointByName(endpointName)
}
// getSandboxPortMapInfo retrieves the current port-mapping programmed for the given sandbox
func getSandboxPortMapInfo(sb libnetwork.Sandbox) nat.PortMap {
pm := nat.PortMap{}

13
daemon/network_windows.go Normal file
View File

@ -0,0 +1,13 @@
package daemon
import (
"strings"
"github.com/docker/libnetwork"
)
// getEndpointInNetwork returns the container's endpoint to the provided network.
func getEndpointInNetwork(name string, n libnetwork.Network) (libnetwork.Endpoint, error) {
endpointName := strings.TrimPrefix(name, "/")
return n.EndpointByName(endpointName)
}