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

Function fsEnsureRoot

pkg/netutil/store.go:36–42  ·  view source on GitHub ↗

NOTE: libcni is not safe to use concurrently - or at least delegates concurrency management to the consumer. Furthermore, CNIEnv (prior to this) is assuming the filesystem is ACID and other TOCTOU faults. This small set of methods here are meant to isolate CNIEnv entirely from the filesystem. This i

(e *CNIEnv, namespace string)

Source from the content-addressed store, hash-verified

34// operations - but for now that will do, waiting for a full rewrite of CNIEnv.
35
36func fsEnsureRoot(e *CNIEnv, namespace string) error {
37 path := e.NetconfPath
38 if namespace != "" {
39 path = filepath.Join(e.NetconfPath, namespace)
40 }
41 return os.MkdirAll(path, 0755)
42}
43
44func fsRemove(e *CNIEnv, net *NetworkConfig) error {
45 fn := func() error {

Callers 2

WithNamespaceFunction · 0.85
NewCNIEnvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…