-
Notifications
You must be signed in to change notification settings - Fork 950
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
feature: add disk quota for container metadata directory #2102
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2102 +/- ##
==========================================
- Coverage 64.88% 64.77% -0.12%
==========================================
Files 208 208
Lines 16458 16482 +24
==========================================
- Hits 10679 10676 -3
- Misses 4451 4477 +26
- Partials 1328 1329 +1
|
test/cli_run_volume_test.go
Outdated
@@ -331,3 +333,65 @@ func (suite *PouchRunVolumeSuite) TestRunWithDiskQuota(c *check.C) { | |||
|
|||
c.Assert(found, check.Equals, true) | |||
} | |||
|
|||
// TestRunWithDiskQuota tests running container with --disk-quota. |
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.
%s/TestRunWithDiskQuota/TestRunWithDiskQuotaForLog
|
||
// set container's metadata directory diskquota, for limit the size of container's logs | ||
metaDir := mgr.Store.Path(c.ID) | ||
err = quota.SetDiskQuota(metaDir, defaultQuota, newID) |
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.
rootfs will be set diskquota twice, will it be a problem? just a question
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.
It is not a problem...
daemon/mgr/container_storage.go
Outdated
} | ||
|
||
defer func() { | ||
if ret := mgr.Unmount(ctx, c); ret != nil { |
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.
can not get the error info when Unmount failed
Add disk quota for container metadata directory, use to limit the size of container's log files. Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
LGTM |
Ⅰ. Describe what this PR did
Add disk quota for container metadata directory, use to limit the size
of container's log files.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Added test case
TestRunWithDiskQuotaForLog
Ⅳ. Describe how to verify it
run test case
TestRunWithDiskQuotaForLog
Ⅴ. Special notes for reviews
Signed-off-by: Rudy Zhang rudyflyzhang@gmail.com