-
Notifications
You must be signed in to change notification settings - Fork 92
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
When preflight
results in FAILED, it exits with code 0
#1131
Comments
I think we would need a few exit codes for at least the following
The exit codes values above are arbitrary except I suggest w also introduce this change in the |
Adding an extra code here: |
= at least one failure, 4 = no failures but at least 1 warn 1 as a catch all, 2 for invalid input etc ref #1131
This is functionally complete, but I need to refactor some changes I made to |
#1135 works now, and tests pass ready for review/merge same with docs replicatedhq/troubleshoot.sh#489 |
0 = all passed, 3 = at least one failure, 4 = no failures but at least 1 warn 1 as a catch all (generic errors), 2 for invalid input/specs etc ref #1131 docs replicatedhq/troubleshoot.sh#489
* adding docs for multiple exit code support in preflight ref replicatedhq/troubleshoot#1131 --------- Co-authored-by: Paige Calvert <paige@replicated.com>
Released in Troubleshoot v0.63.0 |
Bug Description
When I run a preflight test (via
kubectl preflight
), the output might be, for example:Expected Behavior
If I use this in a shell script or any other wrapper that uses preflights as a test to determine if the cluster is up to snuff or not, I need to grep for the output rather than simply use the exit code like most folks would be default.
I would expect the exit code for failed tests to be non-zero, though possibly different if there's an error actually running the preflights as opposed to preflights failing.
Steps To Reproduce
Preflight 0.62.1, Linux/Intel, k3d cluster with one node.
Very simple preflight check:
From what I can see, the preflight package return doesn't do any check to actually return a boolean for the result, just the text of the result itself.
The text was updated successfully, but these errors were encountered: