Browse code

Swarmkit has enabled the plugin filtering logic based on the drivers returned in "docker info". Currently info endpoint isnt using the GetAllByCap, but relies on existing networks to get the plugin names. This causes a basic issue when it comes to global network plugins which swarm-mode relies on, wherein swarmkit will not be able to schedule the network on the worker nodes due to the filtering logic.

In order to break this chicken & egg issue, we must start to use the
GetAllManagedPluginsByCap. We are unable to use GetAllByCap due to
various issues with Plugin-V1's lazy loading approach causing issues
especially during daemon restarts (which uses SystemInfo)

Signed-off-by: Madhu Venugopal <madhu@docker.com>

Madhu Venugopal authored on 2017/01/05 05:38:14
Showing 1 changed files
... ...
@@ -407,6 +407,13 @@ func (daemon *Daemon) GetNetworkDriverList() []string {
407 407
 	}
408 408
 
409 409
 	pluginList := daemon.netController.BuiltinDrivers()
410
+
411
+	managedPlugins := daemon.PluginStore.GetAllManagedPluginsByCap(driverapi.NetworkPluginEndpointType)
412
+
413
+	for _, plugin := range managedPlugins {
414
+		pluginList = append(pluginList, plugin.Name())
415
+	}
416
+
410 417
 	pluginMap := make(map[string]bool)
411 418
 	for _, plugin := range pluginList {
412 419
 		pluginMap[plugin] = true