Explorar o código

Merge pull request #16879 from x1022as/network

remove useless function generateIfaceName()
Vincent Demeester %!s(int64=9) %!d(string=hai) anos
pai
achega
04e883c22b
Modificáronse 1 ficheiros con 0 adicións e 19 borrados
  1. 0 19
      daemon/execdriver/native/create.go

+ 0 - 19
daemon/execdriver/native/create.go

@@ -3,9 +3,7 @@
 package native
 
 import (
-	"errors"
 	"fmt"
-	"net"
 	"strings"
 	"syscall"
 
@@ -13,7 +11,6 @@ import (
 	"github.com/opencontainers/runc/libcontainer/apparmor"
 	"github.com/opencontainers/runc/libcontainer/configs"
 	"github.com/opencontainers/runc/libcontainer/devices"
-	"github.com/opencontainers/runc/libcontainer/utils"
 )
 
 // createContainer populates and configures the container type with the
@@ -103,22 +100,6 @@ func (d *Driver) createContainer(c *execdriver.Command, hooks execdriver.Hooks)
 	return container, nil
 }
 
-func generateIfaceName() (string, error) {
-	for i := 0; i < 10; i++ {
-		name, err := utils.GenerateRandomName("veth", 7)
-		if err != nil {
-			continue
-		}
-		if _, err := net.InterfaceByName(name); err != nil {
-			if strings.Contains(err.Error(), "no such") {
-				return name, nil
-			}
-			return "", err
-		}
-	}
-	return "", errors.New("Failed to find name for new interface")
-}
-
 func (d *Driver) createNetwork(container *configs.Config, c *execdriver.Command, hooks execdriver.Hooks) error {
 	if c.Network == nil {
 		return nil