(stateDir string)
| 97 | } |
| 98 | |
| 99 | func 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. |
no test coverage detected
searching dependent graphs…