MCPcopy
hub / github.com/moby/moby / runInNetNS

Method runInNetNS

daemon/daemon_linux.go:242–251  ·  view source on GitHub ↗
(f func() error)

Source from the content-addressed store, hash-verified

240}
241
242func (daemon *Daemon) runInNetNS(f func() error) error {
243 if rootless.RunningWithRootlessKit() {
244 if detachedNetNS, err := rootless.DetachedNetNS(); err != nil {
245 return err
246 } else if detachedNetNS != "" {
247 return rootless.RunInNetNS(detachedNetNS, f)
248 }
249 }
250 return f()
251}

Callers 11

RawSysInfoMethod · 0.95
initializeCreatedTaskMethod · 0.95
initNetworkControllerMethod · 0.95
initializeNetworkingMethod · 0.95
releaseNetworkMethod · 0.95
ConnectToNetworkMethod · 0.95
DisconnectFromNetworkMethod · 0.95
CreateManagedNetworkMethod · 0.95
CreateNetworkMethod · 0.95
DeleteManagedNetworkMethod · 0.95
DeleteNetworkMethod · 0.95

Calls 2

RunningWithRootlessKitFunction · 0.92
RunInNetNSFunction · 0.92

Tested by

no test coverage detected