1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #1016 from nerdalert/modprobe

Removed experimental drivers modprobe check
This commit is contained in:
Madhu Venugopal 2016-03-11 14:15:30 -08:00
commit 433b29baca
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, ".") {