Skip to content
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

feat: Optimize quota checking when pushing images #17392

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

lengrongfu
Copy link
Contributor

@lengrongfu lengrongfu commented Aug 12, 2022

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Create a zero-length resource when calling the post /v2/library/ubuntu/blobs/uploads/ API to check if the quota is full.

Issue being fixed

Fixes #17390

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/new-feature,"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@lengrongfu lengrongfu requested a review from a team as a code owner August 12, 2022 09:08
@codecov
Copy link

codecov bot commented Aug 12, 2022

Codecov Report

Merging #17392 (0c2c983) into main (9d28d1f) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 0c2c983 differs from pull request most recent head c42b183. Consider uploading reports for the commit c42b183 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17392      +/-   ##
==========================================
+ Coverage   67.34%   67.36%   +0.02%     
==========================================
  Files         980      980              
  Lines      106829   106750      -79     
  Branches     2665     2665              
==========================================
- Hits        71943    71915      -28     
+ Misses      31019    30976      -43     
+ Partials     3867     3859       -8     
Flag Coverage Δ
unittests 67.36% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pkg/quota/util.go 87.50% <100.00%> (ø)
...rver/middleware/quota/post_initiate_blob_upload.go 72.22% <100.00%> (+11.11%) ⬆️

... and 14 files with indirect coverage changes

@OrlinVasilev OrlinVasilev added the release-note/enhancement Label to mark PR to be added under release notes as enhancement label Sep 26, 2022
@OrlinVasilev
Copy link
Member

@lengrongfu thank you for your PR super happy to see your contribution! someone from the @goharbor/all-maintainers will review soon :)

@wy65701436
Copy link
Contributor

@lengrongfu I will take the time to evaluate this PR, thank you for your contribution.

@github-actions
Copy link

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions bot added the Stale label Jan 28, 2023
@Vad1mo Vad1mo removed the Stale label Jan 28, 2023
@lengrongfu
Copy link
Contributor Author

@OrlinVasilev Hi, can we arrange maintainers who have time or are willing to review.

@OrlinVasilev
Copy link
Member

Hi @lengrongfu will add it to the next community meeting agenda for review but it will be great if you can join us there! Thanks!

@lengrongfu
Copy link
Contributor Author

Hi @lengrongfu will add it to the next community meeting agenda for review but it will be great if you can join us there! Thanks!

I'd love to, I'll get in touch with you on Slack, thanks.

@github-actions
Copy link

github-actions bot commented Apr 8, 2023

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@OrlinVasilev
Copy link
Member

@lengrongfu can you please remind me did you presented that on the community meetings ?
@wy65701436 @MinerYang @AllForNothing can you please check this one

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@wy65701436 wy65701436 left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: lengrongfu <1275177125@qq.com>
@chlins chlins merged commit 8fe578e into goharbor:main Jun 5, 2023
WilfredAlmeida pushed a commit to WilfredAlmeida/harbor that referenced this pull request Jul 8, 2023
Signed-off-by: lengrongfu <1275177125@qq.com>
Signed-off-by: Wilfred Almeida <60785452+WilfredAlmeida@users.noreply.github.com>
WilfredAlmeida pushed a commit to WilfredAlmeida/harbor that referenced this pull request Jul 8, 2023
Signed-off-by: lengrongfu <1275177125@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate/2.9.0 release-note/enhancement Label to mark PR to be added under release notes as enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize the push image processing logic when the quota is full
6 participants