1 Star 0 Fork 58

gnaygnil/docker

forked from src-openEuler/docker 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0006-prjquota-overlay2-quota-control-backward-comp.patch 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
gnaygnil 提交于 2020-02-13 15:36 . docker: Fixed build error and URL
From c5a18b46152c4c7016c0c2f0054e276a53f25e1f Mon Sep 17 00:00:00 2001
From: lujingxiao <lujingxiao@huawei.com>
Date: Sat, 19 Jan 2019 11:14:09 +0800
Subject: [PATCH 006/111] prjquota: overlay2 quota control backward
compability
reason: In Euleros docker we support default quota control limit
for daemon with commit
docker: Add options to surport default limit for daemon
However in mainstream they have similar commit
35903110 Add overlay2.size daemon storage-opt
But mainstream uses different api `overlay2.size` compares with
`overlay2.basesize`, so adding this backward compability.
Change-Id: I36a548bd7f1ce6fab6cad24cfb49faa56f7a1fd1
Signed-off-by: lujingxiao <lujingxiao@huawei.com>
---
components/engine/daemon/graphdriver/overlay2/overlay.go | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/components/engine/daemon/graphdriver/overlay2/overlay.go b/components/engine/daemon/graphdriver/overlay2/overlay.go
index 96f44ba9a1..b969582eb3 100644
--- a/components/engine/daemon/graphdriver/overlay2/overlay.go
+++ b/components/engine/daemon/graphdriver/overlay2/overlay.go
@@ -248,6 +248,7 @@ func parseOptions(options []string) (*overlayOptions, error) {
return nil, err
}
case "overlay2.size":
+ case "overlay2.basesize":
size, err := units.RAMInBytes(val)
if err != nil {
return nil, err
@@ -394,12 +395,16 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts) (retErr
}
}()
- if opts != nil && len(opts.StorageOpt) > 0 {
+ if (opts != nil && len(opts.StorageOpt) > 0) || d.options.quota.Size > 0 {
driver := &Driver{}
if err := d.parseStorageOpt(opts.StorageOpt, driver); err != nil {
return err
}
+ if driver.options.quota.Size == 0 && d.options.quota.Size > 0 {
+ driver.options.quota.Size = d.options.quota.Size
+ }
+
if driver.options.quota.Size > 0 {
// Set container disk quota limit
if err := d.quotaCtl.SetQuota(dir, driver.options.quota); err != nil {
--
2.17.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gnaygnil/docker.git
git@gitee.com:gnaygnil/docker.git
gnaygnil
docker
docker
master

搜索帮助