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

refactor: make all quota implementation logic clear #1736

Merged
merged 1 commit into from
Aug 3, 2018

Conversation

allencloud
Copy link
Collaborator

Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com

Ⅰ. Describe what this PR did

Once the disk quota implementation code is not well-mantained. This could be the potential risk in the project. Here we need to try to make the interface, variable, code block much more clear and readable.

Then in this PR, I try to refactor to polish the disk quota implement:

  1. add more annotations for the interface, variables, and some code procedure(add example), so that I think unit test case could be added much more easily.
  2. add a simple unit test for that, and more will be in the future.
  3. encapsulate some code into common part like loadQuotaIDs.

Ⅱ. Does this pull request fix one issue?

none

Ⅲ. Describe how you did it

none

Ⅳ. Describe how to verify it

none

Ⅴ. Special notes for reviews

none

@allencloud allencloud force-pushed the refactor-quota branch 2 times, most recently from 620e2eb to eccb3bb Compare July 13, 2018 08:58
@codecov-io
Copy link

codecov-io commented Jul 13, 2018

Codecov Report

Merging #1736 into master will increase coverage by 0.14%.
The diff coverage is 11.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1736      +/-   ##
==========================================
+ Coverage   63.55%   63.69%   +0.14%     
==========================================
  Files         200      201       +1     
  Lines       15527    15492      -35     
==========================================
  Hits         9868     9868              
+ Misses       4424     4388      -36     
- Partials     1235     1236       +1
Flag Coverage Δ
#criv1alpha1test 33.86% <10.86%> (+0.03%) ⬆️
#criv1alpha2test 34.38% <10.86%> (+0.06%) ⬆️
#integrationtest 38.49% <11.41%> (+0.09%) ⬆️
#unittest 20.91% <1.63%> (-0.58%) ⬇️
Impacted Files Coverage Δ
pkg/system/sysinfo.go 63.63% <ø> (ø) ⬆️
storage/quota/set_diskquota.go 9.09% <ø> (ø) ⬆️
daemon/mgr/container.go 54% <0%> (ø) ⬆️
storage/quota/grpquota.go 0% <0%> (ø) ⬆️
daemon/mgr/spec_hook.go 40.62% <100%> (-4.17%) ⬇️
pkg/system/device.go 100% <100%> (ø)
storage/quota/prjquota.go 9.65% <18.75%> (+1.56%) ⬆️
storage/quota/quota.go 17.96% <6.34%> (-1.33%) ⬇️
ctrd/image.go 78.81% <0%> (-2.47%) ⬇️
... and 2 more

@pouchrobot
Copy link
Collaborator

ping @allencloud

CI fails according integration system.
Please refer to the CI failure Details button to corresponding test, and update your PR to pass CI.

If this is flaky test, welcome to track this with profiling an issue.

build url: https://travis-ci.org/alibaba/pouch/builds/404317084
build duration: 372s

Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
@rudyfly
Copy link
Collaborator

rudyfly commented Aug 3, 2018

LGTM

@rudyfly rudyfly merged commit f24197f into AliyunContainerService:master Aug 3, 2018
@allencloud allencloud deleted the refactor-quota branch August 9, 2018 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants