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

feat: Add custom resource health for flux resources #19082

Merged
merged 3 commits into from
Jul 17, 2024

Conversation

adberger
Copy link
Contributor

As shortly discussed here: #18888
This is the second PR to implement custom resource health for flux resources.

Note: Since I couldn't get some resources to get in the Progressing state, I couldn't write proper tests for them:

  • ImagePolicy
  • ImageRepository
  • ImageUpdateAutomation
  • Receiver
  • Bucket
  • GitRepository
  • HelmChart
  • HelmRepository
  • OCIRepository

All checks were written based on the documenation of Flux, e.g. https://fluxcd.io/flux/components/kustomize/kustomizations/#conditions

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).
  • The title of the PR conforms to the Toolchain Guide
  • 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.
  • 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).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
@adberger adberger requested a review from a team as a code owner July 16, 2024 13:45
Copy link

bunnyshell bot commented Jul 16, 2024

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Copy link

bunnyshell bot commented Jul 16, 2024

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
@adberger adberger requested a review from a team as a code owner July 16, 2024 13:49
Copy link
Contributor

@todaywasawesome todaywasawesome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. These are always a little tricky to review just because there's so much but overall I don't see any issues.

Signed-off-by: Dan Garfield <dan@codefresh.io>
@todaywasawesome todaywasawesome enabled auto-merge (squash) July 17, 2024 15:25
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.65%. Comparing base (30a1623) to head (90f92c2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19082   +/-   ##
=======================================
  Coverage   50.65%   50.65%           
=======================================
  Files         315      315           
  Lines       43347    43347           
=======================================
  Hits        21959    21959           
  Misses      18885    18885           
  Partials     2503     2503           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@todaywasawesome todaywasawesome merged commit 824d0dc into argoproj:master Jul 17, 2024
28 of 29 checks passed
@adberger
Copy link
Contributor Author

Looks good. These are always a little tricky to review just because there's so much but overall I don't see any issues.

Thank you :)
I'll gladly fix any issues popping up

ggjulio pushed a commit to ggjulio/argo-cd that referenced this pull request Jul 21, 2024
* feat: Add custom resource health for flux resources

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>

* chore: Update upgrade docs

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>

---------

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
Signed-off-by: Dan Garfield <dan@codefresh.io>
Co-authored-by: Dan Garfield <dan@codefresh.io>
vfaergestad pushed a commit to vfaergestad/argo-cd that referenced this pull request Jul 22, 2024
* feat: Add custom resource health for flux resources

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>

* chore: Update upgrade docs

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>

---------

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
Signed-off-by: Dan Garfield <dan@codefresh.io>
Co-authored-by: Dan Garfield <dan@codefresh.io>
Signed-off-by: Vegard Færgestad <vegardf@mnemonic.no>
@crenshaw-dev
Copy link
Member

@adberger I looks like maybe the health checks don't show the paused status? Just did a quick test, when I suspend a resource, it's just marked as healthy. I'm not sure if that's intentional.

@adberger
Copy link
Contributor Author

adberger commented Aug 7, 2024

@adberger I looks like maybe the health checks don't show the paused status? Just did a quick test, when I suspend a resource, it's just marked as healthy. I'm not sure if that's intentional.

@crenshaw-dev that's right.
AFAIK Argo CD "only" knows Healthy, Progressing and Degraded.
What state should a suspended Flux respurce show in your opinion?

@crenshaw-dev
Copy link
Member

I think "Suspended" might actually be a good status. It's lightly documented here: https://argo-cd.readthedocs.io/en/stable/operator-manual/health/#way-1-define-a-custom-health-check-in-argocd-cm-configmap

Suspended - the resource is suspended and waiting for some external event to resume (e.g. suspended CronJob or paused Deployment)

@adberger
Copy link
Contributor Author

adberger commented Aug 8, 2024

I think "Suspended" might actually be a good status. It's lightly documented here: https://argo-cd.readthedocs.io/en/stable/operator-manual/health/#way-1-define-a-custom-health-check-in-argocd-cm-configmap

Suspended - the resource is suspended and waiting for some external event to resume (e.g. suspended CronJob or paused Deployment)

Oh, I didn't know that "Suspended" exists :D
I'll try to submit a PR next week, thanks.

@crenshaw-dev
Copy link
Member

Yeah it's deep lore tbh. Thanks!

@adberger
Copy link
Contributor Author

@crenshaw-dev let me know what you think about it: #19508 :)

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.

None yet

4 participants