feat(linux_networking.go): add more error info

Direct people to a potentially missing hostPID attribute in their
kube-router deployment if they are getting a no such file or directory
message.
This commit is contained in:
Aaron U'Ren 2023-12-08 16:44:02 -06:00 committed by Aaron U'Ren
parent eb2628874c
commit eb462bae08

View File

@ -625,7 +625,9 @@ func (ln *linuxNetworking) findIfaceLinkForPid(pid int) (int, error) {
sysFSNetClassRelPath) sysFSNetClassRelPath)
entries, err := os.ReadDir(ifacesPath) entries, err := os.ReadDir(ifacesPath)
if err != nil { if err != nil {
klog.Warningf("could not list: %s due to: %v", ifacesPath, entries) klog.Warningf("Could not list: %s due to: %v", ifacesPath, err)
klog.Warning("If above error was 'no such file or directory' it may be that you haven't enabled " +
"'hostPID=true' in your kube-router deployment")
return return
} }
var sb strings.Builder var sb strings.Builder