Add options to set CNI config and binary directories

Also make clearer the function of --network-plugin-dir when using CNI
This commit is contained in:
Bryan Boreham
2016-09-06 17:41:18 +01:00
committed by Bryan Boreham
parent dc529a03b1
commit 4e961e2bf5
10 changed files with 49 additions and 16 deletions

View File

@@ -90,12 +90,16 @@ func ProbeVolumePlugins(pluginDir string) []volume.VolumePlugin {
}
// ProbeNetworkPlugins collects all compiled-in plugins
func ProbeNetworkPlugins(pluginDir string) []network.NetworkPlugin {
func ProbeNetworkPlugins(pluginDir, cniConfDir, cniBinDir string) []network.NetworkPlugin {
allPlugins := []network.NetworkPlugin{}
// for backwards-compat, allow pluginDir as a source of CNI config files
if cniConfDir == "" {
cniConfDir = pluginDir
}
// for each existing plugin, add to the list
allPlugins = append(allPlugins, exec.ProbeNetworkPlugins(pluginDir)...)
allPlugins = append(allPlugins, cni.ProbeNetworkPlugins(pluginDir)...)
allPlugins = append(allPlugins, cni.ProbeNetworkPlugins(cniConfDir, cniBinDir)...)
allPlugins = append(allPlugins, kubenet.NewPlugin(pluginDir))
return allPlugins