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
fix: support health assessment for prometheus operator < v0.56 (#5620) #11901
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #11901 +/- ##
=======================================
Coverage 49.49% 49.49%
=======================================
Files 270 270
Lines 47489 47489
=======================================
Hits 23506 23506
Misses 21672 21672
Partials 2311 2311 ☔ View full report in Codecov by Sentry. |
@crenshaw-dev can you please give a look? Thank you |
f717212
to
2c8ea04
Compare
Signed-off-by: Zadkiel Aharonian <hello@zadkiel.fr>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this.
Please check my comments.
if not found_status then | ||
hs = { status = "Unknown", message = "Status is not provided" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Argo CD, resources that don't provide status (like ConfigMap and Secrets), are always marked as healthy. The reason is that this impacts the overall Application status and in this case Apps will always be marked as Unknown
. I suggest changing this to healthy instead.
if condition.reason == "SomePodsNotReady" then | ||
hs.status = "Progressing" | ||
if condition.type == "Available" then | ||
found_status = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found_status
should be set to true right after the if obj.status ~= nil then
statement.
if condition.type == "Available" and condition.status ~= "True" then | ||
if condition.reason == "SomePodsNotReady" then | ||
hs.status = "Progressing" | ||
if condition.type == "Available" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no condition is Available
then it should be marked as Unknown
Support health for prometheus operator < v0.56.
Before v0.56, prometheus operator was not updating the status subresource which made the custom health check remain in
Progressing
state forever. See https://github.com/prometheus-operator/prometheus-operator/blob/main/CHANGELOG.md#0560--2022-04-20All thanks goes to @pstatham-tx
Fixes #5620
Fixes #11261
Relates to #11782
Checklist: