DetachedNetNS returns non-empty netns path if RootlessKit is running with --detach-netns mode. Otherwise returns "" without an error.
()
| 86 | // DetachedNetNS returns non-empty netns path if RootlessKit is running with --detach-netns mode. |
| 87 | // Otherwise returns "" without an error. |
| 88 | func 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 | |
| 99 | func detachedNetNS(stateDir string) (string, error) { |
| 100 | p := filepath.Join(stateDir, "netns") |
no test coverage detected
searching dependent graphs…