MCPcopy Create free account
hub / github.com/containers/common / getCniInterface

Function getCniInterface

libnetwork/network/interface.go:164–180  ·  view source on GitHub ↗
(conf *config.Config)

Source from the content-addressed store, hash-verified

162}
163
164func getCniInterface(conf *config.Config) (types.ContainerNetwork, error) {
165 confDir := conf.Network.NetworkConfigDir
166 if confDir == "" {
167 var err error
168 confDir, err = getDefultCNIConfigDir()
169 if err != nil {
170 return nil, err
171 }
172 }
173 return cni.NewCNINetworkInterface(&cni.InitConfig{
174 CNIConfigDir: confDir,
175 CNIPluginDirs: conf.Network.CNIPluginDirs,
176 DefaultNetwork: conf.Network.DefaultNetwork,
177 DefaultSubnet: conf.Network.DefaultSubnet,
178 IsMachine: conf.Engine.MachineEnabled,
179 })
180}
181
182func getDefultCNIConfigDir() (string, error) {
183 if !unshare.IsRootless() {

Callers 2

NetworkBackendFunction · 0.85
defaultNetworkBackendFunction · 0.85

Calls 2

NewCNINetworkInterfaceFunction · 0.92
getDefultCNIConfigDirFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…