-
Notifications
You must be signed in to change notification settings - Fork 5k
Allow disable audit log to DB when initialize #22452
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
Conversation
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:
|
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]>
eb4b51b
to
9233997
Compare
|
||
// 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return error and fail fast would be better if the user sets an invalid value.
// 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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: