node-lifecycle-controller: improve monitorNodeHealth test-coverage (#116687)

* node-lifecycle-controller: refactor monitorNodeHealth tests to improve test-coverage

* address PR review comments

* dedupe test logic
This commit is contained in:
Andrea Tosatto 2023-04-12 16:02:33 +02:00 committed by GitHub
parent afcc207feb
commit d09842e0ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 620 additions and 508 deletions

View File

@ -653,9 +653,11 @@ func (nc *Controller) doNoExecuteTaintingPass(ctx context.Context) {
}
}
// monitorNodeHealth verifies node health are constantly updated by kubelet, and
// if not, post "NodeReady==ConditionUnknown".
// This function will taint nodes who are not ready or not reachable for a long period of time.
// monitorNodeHealth verifies node health are constantly updated by kubelet, and if not, post "NodeReady==ConditionUnknown".
// This function will
// - add nodes which are not ready or not reachable for a long period of time to a rate-limited
// queue so that NoExecute taints can be added by the goroutine running the doNoExecuteTaintingPass function,
// - update the PodReady condition Pods according to the state of the Node Ready condition.
func (nc *Controller) monitorNodeHealth(ctx context.Context) error {
start := nc.now()
defer func() {

File diff suppressed because it is too large Load Diff