Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manager/scheduler/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (f *PluginFilter) Check(n *NodeInfo) bool {
}
}

if f.t.Spec.LogDriver != nil {
if f.t.Spec.LogDriver != nil && f.t.Spec.LogDriver.Name != "none" {
// If there are no log driver types in the list at all, most likely this is
// an older daemon that did not report this information. In this case don't filter
if typeFound, exists := f.pluginExistsOnNode("Log", f.t.Spec.LogDriver.Name, nodePlugins); !exists && typeFound {
Expand Down
27 changes: 27 additions & 0 deletions manager/scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2565,6 +2565,24 @@ func TestSchedulerPluginConstraint(t *testing.T) {
},
}

// no logging
t6 := &api.Task{
ID: "task6_ID",
DesiredState: api.TaskStateRunning,
Spec: api.TaskSpec{
Runtime: &api.TaskSpec_Container{
Container: &api.ContainerSpec{},
},
LogDriver: &api.Driver{Name: "none"},
},
ServiceAnnotations: api.Annotations{
Name: "task6",
},
Status: api.TaskStatus{
State: api.TaskStatePending,
},
}

s := store.NewMemoryStore(nil)
assert.NotNil(t, s)
defer s.Close()
Expand Down Expand Up @@ -2668,6 +2686,15 @@ func TestSchedulerPluginConstraint(t *testing.T) {
assignment4 := watchAssignment(t, watch)
assert.Equal(t, assignment4.ID, "task5_ID")
assert.Equal(t, assignment4.NodeID, "node4_ID")

err = s.Update(func(tx store.Tx) error {
assert.NoError(t, store.CreateTask(tx, t6))
return nil
})
assert.NoError(t, err)
assignment5 := watchAssignment(t, watch)
assert.Equal(t, assignment5.ID, "task6_ID")
assert.NotEqual(t, assignment5.NodeID, "")
}

func BenchmarkScheduler1kNodes1kTasks(b *testing.B) {
Expand Down