Skip to content

Commit 4d0e86f

Browse files
authored
Merge pull request kubernetes#89823 from gongguan/fix-89729
Do not forget recording loaded modules
2 parents 5ea2d69 + 619f657 commit 4d0e86f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/proxy/ipvs/proxier.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ func (handle *LinuxKernelHandler) GetModules() ([]string, error) {
608608
}
609609
ipvsModules := utilipvs.GetRequiredIPVSModules(kernelVersion)
610610

611-
var bmods []string
611+
var bmods, lmods []string
612612

613613
// 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
614614
modulesFile, err := os.Open("/proc/modules")
@@ -650,11 +650,15 @@ func (handle *LinuxKernelHandler) GetModules() ([]string, error) {
650650
if err != nil {
651651
klog.Warningf("Failed to load kernel module %v with modprobe. "+
652652
"You can ignore this message when kube-proxy is running inside container without mounting /lib/modules", module)
653+
} else {
654+
lmods = append(lmods, module)
653655
}
654656
}
655657
}
656658

657-
return append(mods, bmods...), nil
659+
mods = append(mods, bmods...)
660+
mods = append(mods, lmods...)
661+
return mods, nil
658662
}
659663

660664
// getFirstColumn reads all the content from r into memory and return a

0 commit comments

Comments
 (0)