"--min-score" flag returns non-zero exit even when threshold is met
Describe the bug
The documentation about min-score says: "Force non-zero exit if the cluster score is below that threshold". This means that when above that threshold, the exit should be zero or? If thats the case, then from my testing the min-score flag does not seem to work properly as I'm getting non-zero exit even though the threshold is met. More precisely, seems like it only works when provided a specific namespace + specific resource? Maybe I'm using the tool wrong. I would appreciate any guidance.
To Reproduce
I run popeye --all-namespaces --min-score=10 and get an output:
Your cluster score: B (86)`.
❯ echo $?
1 # should be 0
When i run popeye on a namespace, e.g. via popeye --namespace test --min-score=10, i get
Your cluster score: A (94)
❯ echo $?
1 # should be 0
Now, when i run the same command but on a specific resource, e.g. via popeye --namespace test -s pod --min-score=10, i get
Your cluster score: F (23)
❯ echo $?
0 # correct
When i run the command on a specific resource but on all namespaces, e.g. via popeye --all-namespaces -s pod --min-score=1, i get
Your cluster score: F (3)
❯ echo $?
1 # should be 0
Expected behavior
Expected to receive a zero-exit everytime the min-score threshold is met.
Versions (please complete the following information):
- OS: Ubuntu 22.04.5 LTS
- Popeye 0.22.1
- K8s v1.33.2