Allow disable audit log to DB when initialize#22452
Merged
Merged
Conversation
5 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #22452 +/- ##
===========================================
+ Coverage 45.36% 65.84% +20.47%
===========================================
Files 244 1073 +829
Lines 13333 116105 +102772
Branches 2719 2931 +212
===========================================
+ Hits 6049 76447 +70398
- Misses 6983 35421 +28438
- Partials 301 4237 +3936
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
wy65701436
force-pushed
the
init-skip-auditlog
branch
from
October 11, 2025 12:03
24a2586 to
eb4b51b
Compare
Fixes goharbor#22257 Add support for SKIP_LOG_AUDIT_DATABASE env to control audit log database storage during Harbor initialization. Signed-off-by: wang yan <[email protected]>
wy65701436
force-pushed
the
init-skip-auditlog
branch
from
October 11, 2025 12:14
eb4b51b to
9233997
Compare
stonezdj
reviewed
Oct 13, 2025
stonezdj
reviewed
Oct 13, 2025
|
|
||
| // Allow user to disable writing audit log to db by env while initialize | ||
| if err := initSkipAuditDBbyEnv(ctx); err != nil { | ||
| log.Errorf("Failed to initialize SkipAuditDB by ENV: %v", err) |
Contributor
There was a problem hiding this comment.
Return error and fail fast would be better if the user sets an invalid value.
stonezdj
reviewed
Oct 13, 2025
| // Save - save config item into config driver | ||
| Save(ctx context.Context, cfg map[string]any) error | ||
| // Get - get config item from config driver | ||
| Get(ctx context.Context, key string) (map[string]any, error) |
Contributor
There was a problem hiding this comment.
Actually GetFromDriver will be delegate to Get, consider use GetFromDriver as the name to make it more readable.
method name Get is too general, and maybe misused in future, use the same name GetFromDriver would be better.
stonezdj
approved these changes
Oct 13, 2025
wy65701436
enabled auto-merge (squash)
October 17, 2025 03:24
OrlinVasilev
pushed a commit
to OrlinVasilev/harbor
that referenced
this pull request
Oct 29, 2025
Fixes goharbor#22257 Add support for SKIP_LOG_AUDIT_DATABASE env to control audit log database storage during Harbor initialization. Signed-off-by: wang yan <[email protected]> Co-authored-by: wang yan <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22257
Add support for SKIP_LOG_AUDIT_DATABASE env to control audit log database storage during Harbor initialization.
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Issue being fixed
Fixes #(issue)
Please indicate you've done the following: