-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix: add storage_limit check #19095
fix: add storage_limit check #19095
Conversation
Codecov Report
@@ Coverage Diff @@
## main #19095 +/- ##
=======================================
Coverage 67.39% 67.40%
=======================================
Files 992 993 +1
Lines 108791 108812 +21
Branches 2751 2751
=======================================
+ Hits 73325 73345 +20
+ Misses 31528 31525 -3
- Partials 3938 3942 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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
strVal := utils.GetStrValueOfAnyType(value) | ||
|
||
// check storage per project before setting it | ||
if key == common.StoragePerProject { |
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.
why put the specific checking at here?
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.
Because the check is only for common.StoragePerProject
src/pkg/config/manager.go
Outdated
if err != nil { | ||
return fmt.Errorf("cannot parse string value(%v) to int64", strVal) | ||
} | ||
if storagePerProject <= 0 { |
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.
Because same code appear twice, suggest to extract to function
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.
thanks for the review. It has been refactored.
…hod to validate quota limit value) Signed-off-by: Shengwen Yu <[email protected]>
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Issue being fixed
Fixes #18091
task item: 1
Please indicate you've done the following: