MCPcopy Create free account
hub / github.com/containerd/nerdctl / detachedNetNS

Function detachedNetNS

pkg/rootlessutil/rootlessutil_linux.go:99–108  ·  view source on GitHub ↗
(stateDir string)

Source from the content-addressed store, hash-verified

97}
98
99func detachedNetNS(stateDir string) (string, error) {
100 p := filepath.Join(stateDir, "netns")
101 if _, err := os.Stat(p); err != nil {
102 if errors.Is(err, os.ErrNotExist) {
103 return "", nil
104 }
105 return "", err
106 }
107 return p, nil
108}
109
110// WithDetachedNetNSIfAny executes fn in [DetachedNetNS] if RootlessKit is running with --detach-netns mode.
111// Otherwise it just executes fn in the current netns.

Callers 2

ParentMainFunction · 0.85
DetachedNetNSFunction · 0.85

Calls 1

StatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…