Skip to content

Commit 0bef94e

Browse files
committed
fix flaky recorder: use recorder pid to determine mntns
since the process we spawn is in the same mount namespace as the recorder, we can just use our own pid to determine the namespace and avoid any race
1 parent 5a1e2a3 commit 0bef94e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/pkg/cli/recorder/recorder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (r *Recorder) Run() error {
105105
return fmt.Errorf("run command: %w", err)
106106
}
107107

108-
mntns, err = r.FindProcMountNamespace(r.bpfRecorder, pid)
108+
mntns, err = r.FindProcMountNamespace(r.bpfRecorder, uint32(os.Getpid()))
109109
if err != nil {
110110
return fmt.Errorf("finding mntns of PID %d: %w", pid, err)
111111
}

0 commit comments

Comments
 (0)