additional consistency checking on nodes api

This commit is contained in:
Chris Baker 2021-03-24 16:36:18 +00:00
parent 0c590476fd
commit 33efc0e008
1 changed files with 2 additions and 0 deletions

View File

@ -266,6 +266,8 @@ func TestNodes_ToggleDrain(t *testing.T) {
for _, e := range events.Events {
node, err := e.Node()
require.NoError(err)
require.Equal(node.DrainStrategy != nil, node.Drain)
require.True(!node.Drain || node.SchedulingEligibility == NodeSchedulingIneligible) // node.Drain => "ineligible"
if node.Drain && node.SchedulingEligibility == NodeSchedulingIneligible {
sawDraining = node.ModifyIndex
} else if sawDraining != 0 && node.ModifyIndex > sawDraining &&