diff --git a/libnetwork/drivers/ipvlan/ipvlan_network.go b/libnetwork/drivers/ipvlan/ipvlan_network.go index 3609773a90..b39cb5a25f 100644 --- a/libnetwork/drivers/ipvlan/ipvlan_network.go +++ b/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 { diff --git a/libnetwork/drivers/ipvlan/ipvlan_setup.go b/libnetwork/drivers/ipvlan/ipvlan_setup.go index 68eb3ee6cc..60d3d965ca 100644 --- a/libnetwork/drivers/ipvlan/ipvlan_setup.go +++ b/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, ".") { diff --git a/libnetwork/drivers/macvlan/macvlan_network.go b/libnetwork/drivers/macvlan/macvlan_network.go index c5eb9d8d1b..2fb616a1ff 100644 --- a/libnetwork/drivers/macvlan/macvlan_network.go +++ b/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 { diff --git a/libnetwork/drivers/macvlan/macvlan_setup.go b/libnetwork/drivers/macvlan/macvlan_setup.go index f0b74edb53..8a56e88589 100644 --- a/libnetwork/drivers/macvlan/macvlan_setup.go +++ b/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, ".") {