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

Function CDISpecDirs

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

Source from the content-addressed store, hash-verified

145}
146
147func CDISpecDirs() []string {
148 if !rootlessutil.IsRootless() {
149 return []string{"/etc/cdi", "/var/run/cdi"}
150 }
151 xch, err := rootlessutil.XDGConfigHome()
152 if err != nil {
153 panic(err)
154 }
155 xdr, err := rootlessutil.XDGRuntimeDir()
156 if err != nil {
157 if rootlessutil.IsRootlessChild() {
158 panic(err)
159 }
160 xdr = fmt.Sprintf("/run/user/%d", os.Geteuid())
161 }
162 return []string{
163 filepath.Join(xch, "cdi"),
164 filepath.Join(xdr, "cdi"),
165 }
166}

Callers

nothing calls this directly

Calls 4

IsRootlessFunction · 0.92
XDGConfigHomeFunction · 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…