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

Function CNIRuntimeDir

pkg/defaults/defaults_linux.go:91–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89}
90
91func CNIRuntimeDir() (string, error) {
92 if !rootlessutil.IsRootless() {
93 return "/run/cni", nil
94 }
95 xdr, err := rootlessutil.XDGRuntimeDir()
96 if err != nil {
97 if rootlessutil.IsRootlessChild() {
98 return "", err
99 }
100 xdr = fmt.Sprintf("/run/user/%d", os.Geteuid())
101 }
102 return filepath.Join(xdr, "cni"), nil
103}
104
105func NerdctlTOML() string {
106 if !rootlessutil.IsRootless() {

Callers

nothing calls this directly

Calls 3

IsRootlessFunction · 0.92
XDGRuntimeDirFunction · 0.92
IsRootlessChildFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…