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

Function fsRead

pkg/netutil/store.go:76–96  ·  view source on GitHub ↗
(e *CNIEnv)

Source from the content-addressed store, hash-verified

74}
75
76func 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
98func getConfigPathForNetworkName(e *CNIEnv, netName string) string {
99 if netName == DefaultNetworkName || e.Namespace == "" {

Callers 6

ListNetworksMatchMethod · 0.85
NetworkListMethod · 0.85
NetworkMapMethod · 0.85
NetworkByNameOrIDMethod · 0.85
filterNetworksMethod · 0.85
usedSubnetsMethod · 0.85

Calls 2

WithReadOnlyLockFunction · 0.92
cniLoadFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…