From c2938b299d9ce0c3eb7a8c0d48ae286c4039e3cf Mon Sep 17 00:00:00 2001 From: Robert Rati Date: Fri, 20 Mar 2015 16:04:37 -0400 Subject: [PATCH] Only schedule to pods that are available. #5545 --- plugin/pkg/scheduler/factory/factory.go | 4 ++-- plugin/pkg/scheduler/factory/factory_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/pkg/scheduler/factory/factory.go b/plugin/pkg/scheduler/factory/factory.go index 9ebb67634ed..4fc10b398ad 100644 --- a/plugin/pkg/scheduler/factory/factory.go +++ b/plugin/pkg/scheduler/factory/factory.go @@ -230,8 +230,8 @@ func (factory *ConfigFactory) pollMinions() (cache.Enumerator, error) { } } else { // If no condition is set, we get unknown node condition. In such cases, - // we add nodes unconditionally. - nodes.Items = append(nodes.Items, node) + // do not add the node + glog.V(2).Infof("Minion %s is not available. Skipping", node.Name) } } return &nodeEnumerator{nodes}, nil diff --git a/plugin/pkg/scheduler/factory/factory_test.go b/plugin/pkg/scheduler/factory/factory_test.go index ef634fd096d..d7c47ce8a3e 100644 --- a/plugin/pkg/scheduler/factory/factory_test.go +++ b/plugin/pkg/scheduler/factory/factory_test.go @@ -220,7 +220,7 @@ func TestPollMinions(t *testing.T) { }, }, }, - expectedCount: 6, + expectedCount: 5, }, { minions: []api.Node{ @@ -262,7 +262,7 @@ func TestPollMinions(t *testing.T) { }, }, }, - expectedCount: 1, + expectedCount: 0, }, { minions: []api.Node{ @@ -299,7 +299,7 @@ func TestPollMinions(t *testing.T) { }, }, }, - expectedCount: 1, + expectedCount: 0, }, }