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

fix: support health assessment for prometheus operator < v0.56 (#5620) #11901

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aslafy-z
Copy link
Contributor

@aslafy-z aslafy-z commented Jan 6, 2023

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-20

All thanks goes to @pstatham-tx

Fixes #5620
Fixes #11261
Relates to #11782

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@aslafy-z aslafy-z changed the title fix: support health assessment for prometheus operator < v0.56 fix: support health assessment for prometheus operator < v0.56 (#5620) Jan 6, 2023
@codecov
Copy link

codecov bot commented Jan 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7484f1d) 49.49% compared to head (c6104c1) 49.49%.

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.
📢 Have feedback on the report? Share it here.

@aslafy-z
Copy link
Contributor Author

aslafy-z commented Nov 9, 2023

@crenshaw-dev can you please give a look? Thank you

@aslafy-z aslafy-z force-pushed the patch-2 branch 2 times, most recently from f717212 to 2c8ea04 Compare November 10, 2023 18:40
Signed-off-by: Zadkiel Aharonian <hello@zadkiel.fr>
Copy link
Collaborator

@leoluz leoluz left a 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" }
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus-operator sync stuck progressing argocd progressing state "forever"
2 participants