Browse Source

Merge pull request #46345 from thaJeztah/libnetwork_remove_Endpoint_Interface

libnetwork: remove Endpoint.Interface()
Sebastiaan van Stijn 1 year ago
parent
commit
94e924906c
2 changed files with 2 additions and 18 deletions
  1. 1 17
      libnetwork/endpoint_info.go
  2. 1 1
      libnetwork/network.go

+ 1 - 17
libnetwork/endpoint_info.go

@@ -203,23 +203,7 @@ func (ep *Endpoint) Info() EndpointInfo {
 func (ep *Endpoint) Iface() *EndpointInterface {
 	ep.mu.Lock()
 	defer ep.mu.Unlock()
-
-	if ep.iface != nil {
-		return ep.iface
-	}
-
-	return nil
-}
-
-func (ep *Endpoint) Interface() driverapi.InterfaceInfo {
-	ep.mu.Lock()
-	defer ep.mu.Unlock()
-
-	if ep.iface != nil {
-		return ep.iface
-	}
-
-	return nil
+	return ep.iface
 }
 
 // SetMacAddress allows the driver to set the mac address to the endpoint interface

+ 1 - 1
libnetwork/network.go

@@ -1085,7 +1085,7 @@ func (n *Network) addEndpoint(ep *Endpoint) error {
 		return fmt.Errorf("failed to add endpoint: %v", err)
 	}
 
-	err = d.CreateEndpoint(n.id, ep.id, ep.Interface(), ep.generic)
+	err = d.CreateEndpoint(n.id, ep.id, ep.Iface(), ep.generic)
 	if err != nil {
 		return types.InternalErrorf("failed to create endpoint %s on network %s: %v",
 			ep.Name(), n.Name(), err)