Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏃 Add unit tests for health check function #2472

Merged

Conversation

chuckha
Copy link
Contributor

@chuckha chuckha commented Feb 27, 2020

Signed-off-by: Chuck Ha [email protected]

This codifies (in tests) the expectations we make around meta health checks.

Here are a list of checks included in this PR:

  • When a machine's node was not checked for health. An absence of health from a node is bad.
  • The health check returns an error not related to a node's health. For example, the health check cannot connect to the api server to get a list of nodes.
  • More nodes than machines were checked. This means there are control plane nodes not managed by cluster api and that is considered unhealthy.
  • A machine has a nil node reference. This means the control plane hasn't actually been created or is in the process of being deleted. The control plane cannot be healthy.

cc @dlipovetsky If i'm missing anything you can think of, please let me know!

Somewhat related to #2454

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 27, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chuckha

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2020
@vincepri vincepri added this to the v0.3.0-rc.3 milestone Feb 27, 2020
@chuckha chuckha force-pushed the health-check-unit-tests branch from 298af4c to 502824e Compare February 28, 2020 15:32
@chuckha
Copy link
Contributor Author

chuckha commented Feb 28, 2020

@sethp-nr alright, additional cases are covered!

@sethp-nr
Copy link
Contributor

Awesome, thanks Chuck!

/lgtm (though I don't think I have the bit)

@detiber
Copy link
Member

detiber commented Feb 28, 2020

/lgtm
@sethp-nr we should probably get you added as a reviewer, then 😁

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 28, 2020
@k8s-ci-robot k8s-ci-robot merged commit d2953f9 into kubernetes-sigs:master Feb 28, 2020
@chuckha
Copy link
Contributor Author

chuckha commented Feb 28, 2020

@sethp-nr you can /lgtm since you're in the kubernetes-sigs org (i'm like 99% sure)

but you have to put the /lgtm alone on it's own line

@sethp-nr
Copy link
Contributor

@chuckha Oh, I'll have to try it properly next time.

@detiber I certainly wouldn't say no :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants