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)
| 34 | // operations - but for now that will do, waiting for a full rewrite of CNIEnv. |
| 35 | |
| 36 | func 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 | |
| 44 | func fsRemove(e *CNIEnv, net *NetworkConfig) error { |
| 45 | fn := func() error { |
no outgoing calls
no test coverage detected
searching dependent graphs…