Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/controller/netns/netns.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func FindNetnsForPod(pod *corev1.Pod) (string, error) {
return res, nil
}
}
return "", fmt.Errorf("No matching network namespace found")
return "", fmt.Errorf("no matching network namespace found")
}

func isNotNumber(r rune) bool {
Expand Down Expand Up @@ -121,7 +121,12 @@ func processEntry(proc fs.FS, netnsObserved sets.Set[uint64], filter types.UID,
if err != nil {
return "", nil
}
defer cgroup.Close()
defer func() {
if err := cgroup.Close(); err != nil {
// Log the error or handle it appropriately
log.Errorf("Failed to close cgroup file: %v", err)
}
}()

var cgroupData bytes.Buffer
_, err = io.Copy(&cgroupData, cgroup)
Expand Down
Loading
Loading