Skip to content

Conversation

@mikepilat
Copy link
Contributor

@mikepilat mikepilat commented Sep 5, 2025

Fixes #436
Fixes #515

  • Add log setter for text or JSON log formatting
  • Add CLI option "--log-format", accepts "text" or "json"
  • Defaults to current "text" logging for compatibility

Additionally:

  • Configure cmd go.mod to reference registry-scanner locally to support concurrent changes in both modules

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2025

Codecov Report

❌ Patch coverage is 9.09091% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.58%. Comparing base (ded7a28) to head (2b56830).

Files with missing lines Patch % Lines
cmd/run.go 9.09% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1231      +/-   ##
==========================================
- Coverage   63.77%   63.58%   -0.19%     
==========================================
  Files          23       23              
  Lines        3213     3224      +11     
==========================================
+ Hits         2049     2050       +1     
- Misses       1054     1064      +10     
  Partials      110      110              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

Nice! Thank you.

LGTM.

Copy link
Contributor

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

Sorry, I was too quick with my approval 😅

Please check my comments.

@chengfang
Copy link
Collaborator

According to https://argo-cd.readthedocs.io/en/stable/user-guide/commands/argocd_admin/#options, argocd uses logformat instead of log-format. I think we should probaby follow the existing naming pattern of loglevel (used in both argo-cd and image-updater), and logformat from argocd. The same for the corresponding environmental variable.

@chengfang
Copy link
Collaborator

@mikepilat I moved the changes related to registry-scanner replacement into a seprate #1234 since that could also benefit other PRs in the same concurrent update situation. I also took the liberty to resolve the conflicts and pushed to your branch.

Can you please review the remaining comments in this PR so we can include this in the upcoming release?

@mikepilat
Copy link
Contributor Author

@chengfang Thanks for bringing that upstream! Other PR feedback has been incorporated.

- Add log setter for text or JSON log formatting
- Add CLI option "--log-format", accepts "text" or "json"
- Defaults to current "text" logging for compatibility

Signed-off-by: Michael Pilat <[email protected]>
Signed-off-by: Michael Pilat <[email protected]>
@chengfang chengfang merged commit 62a5452 into argoproj-labs:master Sep 12, 2025
11 checks passed
dkarpele pushed a commit to dkarpele/argocd-image-updater that referenced this pull request Sep 16, 2025
Signed-off-by: Michael Pilat <[email protected]>

(cherry picked from commit 62a5452)
Signed-off-by: Denis Karpelevich <[email protected]>
@mikepilat mikepilat deleted the add-json-logging branch September 21, 2025 23:38
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.

Add optional JSON logging JSON log format option

4 participants