Преглед на файлове

Removed experimental drivers modprobe check

- Kernel requirements are checked w/o modprobe now

Signed-off-by: Brent Salisbury <brent@docker.com>
Brent Salisbury преди 9 години
родител
ревизия
dda75448c3

+ 0 - 4
libnetwork/drivers/ipvlan/ipvlan_network.go

@@ -72,10 +72,6 @@ func (d *driver) CreateNetwork(nid string, option map[string]interface{}, ipV4Da
 
 // createNetwork is used by new network callbacks and persistent network cache
 func (d *driver) createNetwork(config *configuration) error {
-	// fail the network create if the ipvlan kernel module is unavailable
-	if err := kernelSupport(ipvlanType); err != nil {
-		return err
-	}
 	networkList := d.getNetworks()
 	for _, nw := range networkList {
 		if config.Parent == nw.config.Parent {

+ 0 - 22
libnetwork/drivers/ipvlan/ipvlan_setup.go

@@ -1,10 +1,7 @@
 package ipvlan
 
 import (
-	"bufio"
 	"fmt"
-	"os"
-	"os/exec"
 	"strconv"
 	"strings"
 
@@ -72,25 +69,6 @@ func parentExists(ifaceStr string) bool {
 	return true
 }
 
-// kernelSupport for the necessary kernel module for the driver type
-func kernelSupport(networkTpe string) error {
-	// attempt to load the module, silent if successful or already loaded
-	exec.Command("modprobe", ipvlanType).Run()
-	f, err := os.Open("/proc/modules")
-	if err != nil {
-		return err
-	}
-	defer f.Close()
-	s := bufio.NewScanner(f)
-	for s.Scan() {
-		if strings.Contains(s.Text(), ipvlanType) {
-			return nil
-		}
-	}
-
-	return fmt.Errorf("unable to load the Linux kernel module %s", ipvlanType)
-}
-
 // createVlanLink parses sub-interfaces and vlan id for creation
 func createVlanLink(parentName string) error {
 	if strings.Contains(parentName, ".") {

+ 0 - 4
libnetwork/drivers/macvlan/macvlan_network.go

@@ -76,10 +76,6 @@ func (d *driver) CreateNetwork(nid string, option map[string]interface{}, ipV4Da
 
 // createNetwork is used by new network callbacks and persistent network cache
 func (d *driver) createNetwork(config *configuration) error {
-	// fail the network create if the macvlan kernel module is unavailable
-	if err := kernelSupport(macvlanType); err != nil {
-		return err
-	}
 	networkList := d.getNetworks()
 	for _, nw := range networkList {
 		if config.Parent == nw.config.Parent {

+ 0 - 22
libnetwork/drivers/macvlan/macvlan_setup.go

@@ -1,10 +1,7 @@
 package macvlan
 
 import (
-	"bufio"
 	"fmt"
-	"os"
-	"os/exec"
 	"strconv"
 	"strings"
 
@@ -76,25 +73,6 @@ func parentExists(ifaceStr string) bool {
 	return true
 }
 
-// kernelSupport for the necessary kernel module for the driver type
-func kernelSupport(networkTpe string) error {
-	// attempt to load the module, silent if successful or already loaded
-	exec.Command("modprobe", macvlanType).Run()
-	f, err := os.Open("/proc/modules")
-	if err != nil {
-		return err
-	}
-	defer f.Close()
-	s := bufio.NewScanner(f)
-	for s.Scan() {
-		if strings.Contains(s.Text(), macvlanType) {
-			return nil
-		}
-	}
-
-	return fmt.Errorf("unable to load the Linux kernel module %s", macvlanType)
-}
-
 // createVlanLink parses sub-interfaces and vlan id for creation
 func createVlanLink(parentName string) error {
 	if strings.Contains(parentName, ".") {