mirror of
https://github.com/moby/moby.git
synced 2026-01-11 02:31:44 +00:00
14 lines
349 B
Go
14 lines
349 B
Go
package daemon
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/moby/moby/v2/daemon/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)
|
|
}
|