Change:
func TestPollMinions(t *testing.T) { table := []struct { <del> minions []api.Node </del> <ins> minions       []api.Node expectedCount int </ins> }{ { minions: []api.Node{ <del> {ObjectMeta: api.ObjectMeta{Name: "foo"}}, {ObjectMeta: api.ObjectMeta{Name: "bar"}}, </del> <ins> { ObjectMeta: api.ObjectMeta{Name: "foo"}, Status: api.NodeStatus{ Conditions: []api.NodeCondition{ {Kind: api.NodeReady, Status: api.ConditionFull}, }, }, }, { ObjectMeta: api.ObjectMeta{Name: "bar"}, Status: api.NodeStatus{ Conditions: []api.NodeCondition{ {Kind: api.NodeReachable, Status: api.ConditionFull}, }, }, }, { ObjectMeta: api.ObjectMeta{Name: "baz"}, Status: api.NodeStatus{ Conditions: []api.NodeCondition{ {Kind: api.NodeReady, Status: api.ConditionFull}, {Kind: api.NodeReachable, Status: api.ConditionFull}, }, }, }, { ObjectMeta: api.ObjectMeta{Name: "baz"}, Status: api.NodeStatus{ Conditions: []api.NodeCondition{ {Kind: api.NodeReady, Status: api.ConditionFull}, {Kind: api.NodeReady, Status: api.ConditionFull}, }, }, }, </ins> }, <ins> expectedCount: 4, }, { minions: []api.Node{ { ObjectMeta: api.ObjectMeta{Name: "foo"}, Status: api.NodeStatus{ Conditions: []api.NodeCondition{ {Kind: api.NodeReady, Status: api.ConditionFull}, }, }, }, { ObjectMeta: api.ObjectMeta{Name: "bar"}, Status: api.NodeStatus{ Conditions: []api.NodeCondition{ {Kind: api.NodeReady, Status: api.ConditionNone}, }, }, }, }, expectedCount: 1, }, { minions: []api.Node{ { ObjectMeta: api.ObjectMeta{Name: "foo"}, Status: api.NodeStatus{ Conditions: []api.NodeCondition{ {Kind: api.NodeReady, Status: api.ConditionFull}, {Kind: api.NodeReachable, Status: api.ConditionNone}}, }, }, }, expectedCount: 1, }, { minions: []api.Node{ { ObjectMeta: api.ObjectMeta{Name: "foo"}, Status: api.NodeStatus{ Conditions: []api.NodeCondition{ {Kind: api.NodeReachable, Status: api.ConditionFull}, {Kind: "invalidValue", Status: api.ConditionNone}}, }, }, }, expectedCount: 1, }, { minions: []api.Node{ { ObjectMeta: api.ObjectMeta{Name: "foo"}, Status: api.NodeStatus{ Conditions: []api.NodeCondition{}, }, }, }, expectedCount: 1, </ins> }, }

Discussion:
With latest master it can happen that pods get scheduled on minions that are not up and get stuck in state. Also the command now also lists the down minions.
Master now returns all minions, with minion status set. Scheduler hasn't been updated yet. I'll put a fix for this. kubectl should return only running minions, and take a '-a' option to list all minions now. This also needs to be fixed.
, Deyuan Deng wrote:
Yeah, the main concern is that minion status is not as clear as Pod, e.g. running minion may not be eligible to schedule a pod. I'm still trying to figure out the best way to convey the message to client.
Re-open as now list all minions, including down ones. We should probabaly first filter out unhealthy ones in kubectl, before we can show any status.
What do you mean by "filter out"? We should be caching minion status in the apiserver. As proposed, we should show all minions that exist, including unresponsive ones.
I mean do not show down minions for now for consistency (users do not expect down minion to be listed). I agree with what proposed, but I'm trying to figure out how / what we convey the status message to user. NodePhase + NodeConditions are essential for k8s components, but are we going to expose all such data to user?
Why wouldn't users need to see down minions? I would think as an admin i would want to see phase + conditions
nvm My original concern was that phase and conditions are meant to be used by k8s, so we may need some translation to make it easier to understand for admin. Also, they are not fully populated, so I thought we may delay showing status for now. I certainly have no problem showing down minions and adding status. I've created a PR