Skip to content

fix: improve output of zot verify#2745

Merged
rchincha merged 1 commit into
project-zot:mainfrom
andaaron:validate
Oct 25, 2024
Merged

fix: improve output of zot verify#2745
rchincha merged 1 commit into
project-zot:mainfrom
andaaron:validate

Conversation

@andaaron

@andaaron andaaron commented Oct 25, 2024

Copy link
Copy Markdown
Contributor

See #2744, there are 2 updates:

  1. Silence the usage output in case of config verification errors
  2. Wrap the error details in all of the zot configuration errors so they are propagated and shown in stdout for zot verify We also need to keep logging those message to the zot logs file since the same logic is called in the zot serve use case.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

See project-zot#2744, there are 2 updates:
1. Silence the usage output in case of config verification errors
2. Wrap the error details in all of the zot configuration errors so they are propagated and shown in stdout for `zot verify`
We also need to keep logging those message to the zot logs file since the same logic is caled in the `zot serve` use case.

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
@codecov

codecov Bot commented Oct 25, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 93.49593% with 8 lines in your changes missing coverage. Please review.

Project coverage is 92.08%. Comparing base (f735680) to head (5d8b36c).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cli/server/root.go 93.49% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2745   +/-   ##
=======================================
  Coverage   92.08%   92.08%           
=======================================
  Files         169      169           
  Lines       30038    30051   +13     
=======================================
+ Hits        27660    27672   +12     
- Misses       1759     1760    +1     
  Partials      619      619           

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

@andaaron
andaaron marked this pull request as ready for review October 25, 2024 09:40
@andaaron
andaaron requested a review from rchincha as a code owner October 25, 2024 09:40
@andaaron

Copy link
Copy Markdown
Contributor Author

Example based on #2744

bin/zot-linux-amd64 verify examples/test.json
{"level":"error","config":"examples/test.json","time":"2024-10-25T11:15:04.494640658Z","message":"invalid config file"}
Error: invalid server config: invalid database config, dedupe set to true with remote storage and database, but no remote database configured

@rchincha rchincha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@rchincha
rchincha merged commit 51e779f into project-zot:main Oct 25, 2024
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.

2 participants