mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 12:32:03 +00:00
Re-work logic in shouldSyncUpdatedNode
This commit is contained in:
parent
6e541a6da7
commit
d3c103edce
@ -660,15 +660,10 @@ func nodeNames(nodes []*v1.Node) sets.String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func shouldSyncUpdatedNode(oldNode, newNode *v1.Node) bool {
|
func shouldSyncUpdatedNode(oldNode, newNode *v1.Node) bool {
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.StableLoadBalancerNodeSet) {
|
|
||||||
// Only Nodes with changes to the label
|
|
||||||
// "node.kubernetes.io/exclude-from-external-load-balancers" will
|
|
||||||
// trigger a load balancer re-sync.
|
|
||||||
return respectsPredicates(oldNode, nodeIncludedPredicate) != respectsPredicates(newNode, nodeIncludedPredicate)
|
|
||||||
}
|
|
||||||
// Evaluate the individual node exclusion predicate before evaluating the
|
// Evaluate the individual node exclusion predicate before evaluating the
|
||||||
// compounded result of all predicates. We don't sync ETP=local services
|
// compounded result of all predicates. We don't sync changes on the
|
||||||
// for changes on the readiness condition, hence if a node remains NotReady
|
// readiness condition for eTP:Local services or when
|
||||||
|
// StableLoadBalancerNodeSet is enabled, hence if a node remains NotReady
|
||||||
// and a user adds the exclusion label we will need to sync as to make sure
|
// and a user adds the exclusion label we will need to sync as to make sure
|
||||||
// this change is reflected correctly on ETP=local services. The sync
|
// this change is reflected correctly on ETP=local services. The sync
|
||||||
// function compares lastSyncedNodes with the new (existing) set of nodes
|
// function compares lastSyncedNodes with the new (existing) set of nodes
|
||||||
@ -679,7 +674,10 @@ func shouldSyncUpdatedNode(oldNode, newNode *v1.Node) bool {
|
|||||||
if respectsPredicates(oldNode, nodeIncludedPredicate) != respectsPredicates(newNode, nodeIncludedPredicate) {
|
if respectsPredicates(oldNode, nodeIncludedPredicate) != respectsPredicates(newNode, nodeIncludedPredicate) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return respectsPredicates(oldNode, allNodePredicates...) != respectsPredicates(newNode, allNodePredicates...)
|
if !utilfeature.DefaultFeatureGate.Enabled(features.StableLoadBalancerNodeSet) {
|
||||||
|
return respectsPredicates(oldNode, allNodePredicates...) != respectsPredicates(newNode, allNodePredicates...)
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// syncNodes handles updating the hosts pointed to by all load
|
// syncNodes handles updating the hosts pointed to by all load
|
||||||
|
Loading…
Reference in New Issue
Block a user