(e *CNIEnv)
| 74 | } |
| 75 | |
| 76 | func fsRead(e *CNIEnv) ([]*NetworkConfig, error) { |
| 77 | var nc []*NetworkConfig |
| 78 | var err error |
| 79 | err = filesystem.WithReadOnlyLock(filepath.Join(e.NetconfPath, ".nerdctl.lock"), func() error { |
| 80 | namespaced := []string{} |
| 81 | var common []string |
| 82 | common, err = libcni.ConfFiles(e.NetconfPath, []string{".conf", ".conflist", ".json"}) |
| 83 | if err != nil { |
| 84 | return err |
| 85 | } |
| 86 | if e.Namespace != "" { |
| 87 | namespaced, err = libcni.ConfFiles(filepath.Join(e.NetconfPath, e.Namespace), []string{".conf", ".conflist", ".json"}) |
| 88 | if err != nil { |
| 89 | return err |
| 90 | } |
| 91 | } |
| 92 | nc, err = cniLoad(append(common, namespaced...)) |
| 93 | return err |
| 94 | }) |
| 95 | return nc, err |
| 96 | } |
| 97 | |
| 98 | func getConfigPathForNetworkName(e *CNIEnv, netName string) string { |
| 99 | if netName == DefaultNetworkName || e.Namespace == "" { |
no test coverage detected
searching dependent graphs…