From 066c5e9657d7a207a7baeef12b182f7fe468aa54 Mon Sep 17 00:00:00 2001 From: Klaus Ma Date: Thu, 5 Oct 2017 10:29:21 +0800 Subject: [PATCH] Fixed alpha e2e test failure. --- plugin/pkg/scheduler/factory/factory.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/plugin/pkg/scheduler/factory/factory.go b/plugin/pkg/scheduler/factory/factory.go index a4e0170a712..1c7cf34dc27 100644 --- a/plugin/pkg/scheduler/factory/factory.go +++ b/plugin/pkg/scheduler/factory/factory.go @@ -523,15 +523,6 @@ func (c *ConfigFactory) invalidateCachedPredicatesOnNodeUpdate(newNode *v1.Node, // TODO(resouer): think about lazily initialize this set invalidPredicates := sets.NewString() - oldTaints, oldErr := helper.GetTaintsFromNodeAnnotations(oldNode.GetAnnotations()) - if oldErr != nil { - glog.Errorf("Failed to get taints from old node annotation for equivalence cache") - } - newTaints, newErr := helper.GetTaintsFromNodeAnnotations(newNode.GetAnnotations()) - if newErr != nil { - glog.Errorf("Failed to get taints from new node annotation for equivalence cache") - } - if !reflect.DeepEqual(oldNode.Status.Allocatable, newNode.Status.Allocatable) { invalidPredicates.Insert("GeneralPredicates") // "PodFitsResources" } @@ -550,9 +541,20 @@ func (c *ConfigFactory) invalidateCachedPredicatesOnNodeUpdate(newNode *v1.Node, } } } - if !reflect.DeepEqual(oldTaints, newTaints) { + + oldTaints, oldErr := helper.GetTaintsFromNodeAnnotations(oldNode.GetAnnotations()) + if oldErr != nil { + glog.Errorf("Failed to get taints from old node annotation for equivalence cache") + } + newTaints, newErr := helper.GetTaintsFromNodeAnnotations(newNode.GetAnnotations()) + if newErr != nil { + glog.Errorf("Failed to get taints from new node annotation for equivalence cache") + } + if !reflect.DeepEqual(oldTaints, newTaints) || + !reflect.DeepEqual(oldNode.Spec.Taints, newNode.Spec.Taints) { invalidPredicates.Insert("PodToleratesNodeTaints") } + if !reflect.DeepEqual(oldNode.Status.Conditions, newNode.Status.Conditions) { oldConditions := make(map[v1.NodeConditionType]v1.ConditionStatus) newConditions := make(map[v1.NodeConditionType]v1.ConditionStatus)