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

Function DetachedNetNS

pkg/rootlessutil/rootlessutil_linux.go:88–97  ·  view source on GitHub ↗

DetachedNetNS returns non-empty netns path if RootlessKit is running with --detach-netns mode. Otherwise returns "" without an error.

()

Source from the content-addressed store, hash-verified

86// DetachedNetNS returns non-empty netns path if RootlessKit is running with --detach-netns mode.
87// Otherwise returns "" without an error.
88func DetachedNetNS() (string, error) {
89 if !IsRootless() {
90 return "", nil
91 }
92 stateDir, err := RootlessKitStateDir()
93 if err != nil {
94 return "", err
95 }
96 return detachedNetNS(stateDir)
97}
98
99func detachedNetNS(stateDir string) (string, error) {
100 p := filepath.Join(stateDir, "netns")

Callers 1

WithDetachedNetNSIfAnyFunction · 0.70

Calls 3

RootlessKitStateDirFunction · 0.85
detachedNetNSFunction · 0.85
IsRootlessFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…