Merge pull request #116536 from alexanderConstantinescu/pr-115204-followup

[KCCM] service controller - #115204 follow-up
This commit is contained in:
Kubernetes Prow Robot 2023-03-14 17:44:33 -07:00 committed by GitHub
commit 52559dc6fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 344 additions and 1490 deletions

View File

@ -943,6 +943,7 @@ var (
nodeUnTaintedPredicate,
}
stableNodeSetPredicates []NodeConditionPredicate = []NodeConditionPredicate{
nodeNotDeletedPredicate,
nodeIncludedPredicate,
// This is not perfect, but probably good enough. We won't update the
// LBs just because the taint was added (see shouldSyncUpdatedNode) but
@ -989,6 +990,10 @@ func nodeReadyPredicate(node *v1.Node) bool {
return false
}
func nodeNotDeletedPredicate(node *v1.Node) bool {
return node.DeletionTimestamp.IsZero()
}
// listWithPredicate gets nodes that matches all predicate functions.
func listWithPredicates(nodeLister corelisters.NodeLister, predicates ...NodeConditionPredicate) ([]*v1.Node, error) {
nodes, err := nodeLister.List(labels.Everything())