Create testable implementation of sysctl

This is so we can test kubenet Init, which calls sysctl
This commit is contained in:
Justin Santa Barbara
2016-08-10 11:38:44 -04:00
parent 5d25bffffe
commit 2c103af2b6
8 changed files with 84 additions and 13 deletions

View File

@@ -166,7 +166,7 @@ func (plugin *NoopNetworkPlugin) Init(host Host, hairpinMode componentconfig.Hai
// Ensure the netfilter module is loaded on kernel >= 3.18; previously
// it was built-in.
utilexec.New().Command("modprobe", "br-netfilter").CombinedOutput()
if err := utilsysctl.SetSysctl(sysctlBridgeCallIptables, 1); err != nil {
if err := utilsysctl.New().SetSysctl(sysctlBridgeCallIptables, 1); err != nil {
glog.Warningf("can't set sysctl %s: %v", sysctlBridgeCallIptables, err)
}