From 58aab16ff8c249af6504cb8b847b74e3fd047ccf Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 17 May 2017 22:36:07 +0100 Subject: [PATCH] Only filter on plugins if running with docker engine. If there is no engine description then thus assumes that all drivers etc are built-in and this always available, and when they are not proper errors will be generated and propagated. This avoids the need in https://github.com/docker/swarmkit/pull/1965 to populate a spurious `api.NodeDescription.Engine` field (spurious because there is no engine in this case). Signed-off-by: Ian Campbell --- manager/scheduler/filter.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manager/scheduler/filter.go b/manager/scheduler/filter.go index 2909a648d7..df5eb00348 100644 --- a/manager/scheduler/filter.go +++ b/manager/scheduler/filter.go @@ -128,6 +128,12 @@ func (f *PluginFilter) SetTask(t *api.Task) bool { // Check returns true if the task can be scheduled into the given node. // TODO(amitshukla): investigate storing Plugins as a map so it can be easily probed func (f *PluginFilter) Check(n *NodeInfo) bool { + if n.Description == nil || n.Description.Engine == nil { + // If the node is not running Engine, plugins are not + // supported. + return true + } + // Get list of plugins on the node nodePlugins := n.Description.Engine.Plugins