Merge pull request #89823 from gongguan/fix-89729

Do not forget recording loaded modules
This commit is contained in:
Kubernetes Prow Robot 2020-04-04 17:57:46 -07:00 committed by GitHub
commit 4d0e86f0b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -608,7 +608,7 @@ func (handle *LinuxKernelHandler) GetModules() ([]string, error) {
}
ipvsModules := utilipvs.GetRequiredIPVSModules(kernelVersion)
var bmods []string
var bmods, lmods []string
// Find out loaded kernel modules. If this is a full static kernel it will try to verify if the module is compiled using /boot/config-KERNELVERSION
modulesFile, err := os.Open("/proc/modules")
@ -650,11 +650,15 @@ func (handle *LinuxKernelHandler) GetModules() ([]string, error) {
if err != nil {
klog.Warningf("Failed to load kernel module %v with modprobe. "+
"You can ignore this message when kube-proxy is running inside container without mounting /lib/modules", module)
} else {
lmods = append(lmods, module)
}
}
}
return append(mods, bmods...), nil
mods = append(mods, bmods...)
mods = append(mods, lmods...)
return mods, nil
}
// getFirstColumn reads all the content from r into memory and return a