Removed experimental drivers modprobe check

- Kernel requirements are checked w/o modprobe now

Signed-off-by: Brent Salisbury <brent@docker.com>
This commit is contained in:
Brent Salisbury 2016-03-11 17:00:36 -05:00
parent 1fa49a3551
commit dda75448c3
4 changed files with 0 additions and 52 deletions

View File

@ -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 {

View File

@ -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, ".") {

View File

@ -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 {

View File

@ -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, ".") {