!47 lcr: update version to v2.0.5

From: @lifeng2221dd1
Reviewed-by: @duguhaotian
Signed-off-by: @duguhaotian
This commit is contained in:
openeuler-ci-bot 2020-12-30 15:54:42 +08:00 committed by Gitee
commit 36603cfff4
10 changed files with 7 additions and 566 deletions

View File

@ -1,312 +0,0 @@
From 14c30632d33cdce2d3b0bb5072bf8af823003e63 Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Thu, 3 Sep 2020 10:46:38 +0800
Subject: [PATCH 1/7] support local volume
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
src/json/schema/bind-options.json | 12 +++++++++
src/json/schema/container/config-v2.json | 3 +++
src/json/schema/container/inspect.json | 3 +++
src/json/schema/defs.json | 5 +++-
src/json/schema/docker/types/mount-point.json | 3 +++
src/json/schema/host-config.json | 9 +++++++
src/json/schema/mount_spec.json | 27 +++++++++++++++++++
.../schema/volume/list-volume-request.json | 6 +++++
.../schema/volume/list-volume-response.json | 18 +++++++++++++
src/json/schema/volume/options.json | 9 +++++++
.../schema/volume/prune-volume-request.json | 6 +++++
.../schema/volume/prune-volume-response.json | 18 +++++++++++++
.../schema/volume/remove-volume-request.json | 9 +++++++
.../schema/volume/remove-volume-response.json | 12 +++++++++
src/json/schema/volume/volume.json | 12 +++++++++
15 files changed, 151 insertions(+), 1 deletion(-)
create mode 100644 src/json/schema/bind-options.json
create mode 100644 src/json/schema/mount_spec.json
create mode 100644 src/json/schema/volume/list-volume-request.json
create mode 100644 src/json/schema/volume/list-volume-response.json
create mode 100644 src/json/schema/volume/options.json
create mode 100644 src/json/schema/volume/prune-volume-request.json
create mode 100644 src/json/schema/volume/prune-volume-response.json
create mode 100644 src/json/schema/volume/remove-volume-request.json
create mode 100644 src/json/schema/volume/remove-volume-response.json
create mode 100644 src/json/schema/volume/volume.json
diff --git a/src/json/schema/bind-options.json b/src/json/schema/bind-options.json
new file mode 100644
index 0000000..8900361
--- /dev/null
+++ b/src/json/schema/bind-options.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "Propagation": {
+ "type": "string"
+ },
+ "selinux-opts": {
+ "type": "string"
+ }
+ }
+}
diff --git a/src/json/schema/container/config-v2.json b/src/json/schema/container/config-v2.json
index ba97bd8..f299f01 100644
--- a/src/json/schema/container/config-v2.json
+++ b/src/json/schema/container/config-v2.json
@@ -55,6 +55,9 @@
".{1,}": {
"type": "object",
"properties": {
+ "Type": {
+ "type": "string"
+ },
"Destination": {
"type": "string"
},
diff --git a/src/json/schema/container/inspect.json b/src/json/schema/container/inspect.json
index d1c6288..bf53a59 100644
--- a/src/json/schema/container/inspect.json
+++ b/src/json/schema/container/inspect.json
@@ -157,6 +157,9 @@
"Labels": {
"$ref": "../defs.json#/definitions/mapStringString"
},
+ "Volumes": {
+ "$ref": "../defs.json#/definitions/mapStringObject"
+ },
"Annotations": {
"$ref": "../defs.json#/definitions/mapStringString"
},
diff --git a/src/json/schema/defs.json b/src/json/schema/defs.json
index 9512caa..317cab4 100644
--- a/src/json/schema/defs.json
+++ b/src/json/schema/defs.json
@@ -192,6 +192,9 @@
"options": {
"$ref": "#/definitions/ArrayOfStrings"
},
+ "named": {
+ "type": "boolean"
+ },
"type": {
"type": "string"
}
@@ -1073,4 +1076,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/json/schema/docker/types/mount-point.json b/src/json/schema/docker/types/mount-point.json
index 33b7768..f204cdc 100644
--- a/src/json/schema/docker/types/mount-point.json
+++ b/src/json/schema/docker/types/mount-point.json
@@ -2,6 +2,9 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
+ "Type":{
+ "type":"string"
+ },
"Name":{
"type":"string"
},
diff --git a/src/json/schema/host-config.json b/src/json/schema/host-config.json
index ac54b40..eb99c87 100644
--- a/src/json/schema/host-config.json
+++ b/src/json/schema/host-config.json
@@ -2,9 +2,18 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
+ "VolumesFrom": {
+ "$ref": "defs.json#/definitions/ArrayOfStrings"
+ },
"Binds": {
"$ref": "defs.json#/definitions/ArrayOfStrings"
},
+ "Mounts": {
+ "type": "array",
+ "items": {
+ "$ref": "mount_spec.json"
+ }
+ },
"NetworkMode": {
"type": "string"
},
diff --git a/src/json/schema/mount_spec.json b/src/json/schema/mount_spec.json
new file mode 100644
index 0000000..94aa5b3
--- /dev/null
+++ b/src/json/schema/mount_spec.json
@@ -0,0 +1,27 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "Type": {
+ "type": "string"
+ },
+ "Source": {
+ "type": "string"
+ },
+ "Target": {
+ "type": "string"
+ },
+ "Readonly": {
+ "type": "boolean"
+ },
+ "Consistency": {
+ "type": "string"
+ },
+ "BindOptions": {
+ "$ref": "bind-options.json"
+ },
+ "VolumeOptions": {
+ "$ref": "volume/options.json"
+ }
+ }
+}
diff --git a/src/json/schema/volume/list-volume-request.json b/src/json/schema/volume/list-volume-request.json
new file mode 100644
index 0000000..8084880
--- /dev/null
+++ b/src/json/schema/volume/list-volume-request.json
@@ -0,0 +1,6 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ }
+}
diff --git a/src/json/schema/volume/list-volume-response.json b/src/json/schema/volume/list-volume-response.json
new file mode 100644
index 0000000..d89f4e2
--- /dev/null
+++ b/src/json/schema/volume/list-volume-response.json
@@ -0,0 +1,18 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "volumes": {
+ "type": "array",
+ "items": {
+ "$ref": "volume.json"
+ }
+ },
+ "cc": {
+ "type": "uint32"
+ },
+ "errmsg": {
+ "type": "string"
+ }
+ }
+}
diff --git a/src/json/schema/volume/options.json b/src/json/schema/volume/options.json
new file mode 100644
index 0000000..57b3c34
--- /dev/null
+++ b/src/json/schema/volume/options.json
@@ -0,0 +1,9 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "NoCopy": {
+ "type": "boolean"
+ }
+ }
+}
diff --git a/src/json/schema/volume/prune-volume-request.json b/src/json/schema/volume/prune-volume-request.json
new file mode 100644
index 0000000..8084880
--- /dev/null
+++ b/src/json/schema/volume/prune-volume-request.json
@@ -0,0 +1,6 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ }
+}
diff --git a/src/json/schema/volume/prune-volume-response.json b/src/json/schema/volume/prune-volume-response.json
new file mode 100644
index 0000000..064f839
--- /dev/null
+++ b/src/json/schema/volume/prune-volume-response.json
@@ -0,0 +1,18 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "volumes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "cc": {
+ "type": "uint32"
+ },
+ "errmsg": {
+ "type": "string"
+ }
+ }
+}
diff --git a/src/json/schema/volume/remove-volume-request.json b/src/json/schema/volume/remove-volume-request.json
new file mode 100644
index 0000000..788b40d
--- /dev/null
+++ b/src/json/schema/volume/remove-volume-request.json
@@ -0,0 +1,9 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+}
diff --git a/src/json/schema/volume/remove-volume-response.json b/src/json/schema/volume/remove-volume-response.json
new file mode 100644
index 0000000..8c398e8
--- /dev/null
+++ b/src/json/schema/volume/remove-volume-response.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "cc": {
+ "type": "uint32"
+ },
+ "errmsg": {
+ "type": "string"
+ }
+ }
+}
diff --git a/src/json/schema/volume/volume.json b/src/json/schema/volume/volume.json
new file mode 100644
index 0000000..035451f
--- /dev/null
+++ b/src/json/schema/volume/volume.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "driver": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+}
--
2.25.1

View File

@ -1,95 +0,0 @@
From 5ef0ddb02783bbe5abeb0998fe8b65b9138268df Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Tue, 27 Oct 2020 11:15:31 +0800
Subject: [PATCH 2/7] remove extension json config of cni net
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
src/json/schema/cni/net_conf.json | 64 -------------------------------
1 file changed, 64 deletions(-)
diff --git a/src/json/schema/cni/net_conf.json b/src/json/schema/cni/net_conf.json
index 89427ae..7a03a3f 100644
--- a/src/json/schema/cni/net_conf.json
+++ b/src/json/schema/cni/net_conf.json
@@ -43,27 +43,6 @@
"dns": {
"$ref": "network/dns.json"
},
- "multi_entry": {
- "type": "int32"
- },
- "backup_mode": {
- "type": "boolean"
- },
- "vlanID": {
- "type": "int32"
- },
- "vlan_inside": {
- "type": "boolean"
- },
- "vxlanID": {
- "type": "int32"
- },
- "vxlanID_inside": {
- "type": "boolean"
- },
- "actions": {
- "type": "string"
- },
"args": {
"$ref": "net_args.json"
},
@@ -84,49 +63,6 @@
}
}
},
- "log_level": {
- "type": "string"
- },
- "etcd_endpoints": {
- "type": "string"
- },
- "etcd_key_file": {
- "type": "string"
- },
- "etcd_cert_file": {
- "type": "string"
- },
- "etcd_ca_cert_file": {
- "type": "string"
- },
- "mtu": {
- "type": "int32"
- },
- "datastore_type": {
- "type": "string"
- },
- "nodename": {
- "type": "string"
- },
- "policy": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string"
- }
- }
- },
- "kubernetes": {
- "type": "object",
- "properties": {
- "kubeconfig": {
- "type": "string"
- }
- }
- },
- "snat": {
- "type": "boolean"
- },
"capabilities": {
"$ref": "../defs.json#/definitions/mapStringBool"
}
--
2.25.1

View File

@ -1,26 +0,0 @@
From 88f2a60d014299241b6e53f60340b2debc1adc10 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Tue, 3 Nov 2020 17:23:57 +0800
Subject: [PATCH 3/7] fix ctest error when use make
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
tests/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 8110f10..39d0270 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -83,7 +83,7 @@ target_link_libraries(mock_ut
${GTEST_LIBRARY}
pthread
)
-add_dependencies(mock_ut log_ut libocispec_ut)
+add_dependencies(mock_ut log_ut libocispec_ut go_crc64_ut)
# run ut and gcov
if (ENABLE_GCOV)
--
2.25.1

View File

@ -1,29 +0,0 @@
From 59f7c9a721e67edef1eae3b669232eaf298c80b1 Mon Sep 17 00:00:00 2001
From: lifeng68 <lifeng68@huawei.com>
Date: Tue, 17 Nov 2020 18:34:01 +0800
Subject: [PATCH 4/7] rootfs: fix snprintf error when with rootfs options
Signed-off-by: lifeng68 <lifeng68@huawei.com>
---
src/conf.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/conf.c b/src/conf.c
index 8bbdcbe..505985e 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -796,8 +796,9 @@ static int trans_oci_root_rootfs_options(const oci_runtime_spec_root *root, stru
goto out;
}
value = tmpvalue;
- nret = snprintf(value + strlen(value), newsize - strlen(value), ",%s", linux->rootfs_propagation);
- if (nret < 0 || (size_t)nret >= (newsize - strlen(value))) {
+ size_t tmp = newsize - strlen(value);
+ nret = snprintf(value + strlen(value), tmp, ",%s", linux->rootfs_propagation);
+ if (nret < 0 || (size_t)nret >= tmp) {
ERROR("Failed to print string");
goto out;
}
--
2.25.1

View File

@ -1,42 +0,0 @@
From 72cb0bb9f6102751965ec5c4d5216120c75beccb Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Thu, 19 Nov 2020 16:38:35 +0800
Subject: [PATCH 5/7] support default container log options
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
src/json/schema/isulad-daemon-configs.json | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/json/schema/isulad-daemon-configs.json b/src/json/schema/isulad-daemon-configs.json
index 5991f00..27fd916 100644
--- a/src/json/schema/isulad-daemon-configs.json
+++ b/src/json/schema/isulad-daemon-configs.json
@@ -26,6 +26,17 @@
"log-opts": {
"$ref": "defs.json#/definitions/mapStringString"
},
+ "container-log": {
+ "type": "object",
+ "properties": {
+ "driver": {
+ "type": "string"
+ },
+ "opts": {
+ "$ref": "defs.json#/definitions/mapStringString"
+ }
+ }
+ },
"storage-driver": {
"type": "string"
},
@@ -149,4 +160,4 @@
"type": "boolean"
}
}
-}
\ No newline at end of file
+}
--
2.25.1

View File

@ -1,26 +0,0 @@
From 9f1b1b3d10e09b173d345b89a340eb2f61fef682 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Thu, 26 Nov 2020 15:04:18 +0800
Subject: [PATCH 6/7] update describe of lcr
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a1289c5..8a45755 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# lcr
`lcr`(Lightweight Container Runtime) is CLI tool for spawning and running containers according to OCI specification.
-It is based on `liblxc` and written by `C`.
+It is based on `liblxc` and written by `C`. It can use by container engine: [iSulad](https://gitee.com/openeuler/iSulad). [iSulad](https://gitee.com/openeuler/iSulad) use `ldopen` to call functions defined in lcr.
## How to Contribute
--
2.25.1

View File

@ -1,26 +0,0 @@
From 3d3111e54bd129e85dd506964efd6fe0f91cb436 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Wed, 2 Dec 2020 11:29:56 +0800
Subject: [PATCH 7/7] add run count of fuzz test
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
tests/fuzz/fuzz.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/fuzz/fuzz.sh b/tests/fuzz/fuzz.sh
index 6f80cab..d71be7c 100755
--- a/tests/fuzz/fuzz.sh
+++ b/tests/fuzz/fuzz.sh
@@ -23,7 +23,7 @@
#!/bin/bash
LIB_FUZZING_ENGINE="/lib64/libFuzzer.a"
-FUZZ_OPTION="corpus -dict=./dict/log_fuzz.dict -runs=100000 -max_total_time=3600"
+FUZZ_OPTION="corpus -dict=./dict/log_fuzz.dict -runs=10000000 -max_total_time=3600"
if [ ! -f "$LIB_FUZZING_ENGINE" ];then
echo "$LIB_FUZZING_ENGINE not exist, pls check"
--
2.25.1

View File

@ -1,5 +1,5 @@
%global _version 2.0.4
%global _release 20201203.185548.gitcc470dc1
%global _version 2.0.5
%global _release 20201230.150203.git5e91f13f
%global _inner_name isula_libutils
Name: lcr
@ -12,14 +12,6 @@ Group: Applications/System
License: LGPLv2.1+
BuildRoot: %{_tmppath}/lcr-%{version}
Patch9001: 0001-support-local-volume.patch
Patch9002: 0002-remove-extension-json-config-of-cni-net.patch
Patch9003: 0003-fix-ctest-error-when-use-make.patch
Patch9004: 0004-rootfs-fix-snprintf-error-when-with-rootfs-options.patch
Patch9005: 0005-support-default-container-log-options.patch
Patch9006: 0006-update-describe-of-lcr.patch
Patch9007: 0007-add-run-count-of-fuzz-test.patch
BuildRequires: cmake
BuildRequires: lxc
BuildRequires: lxc-devel
@ -107,6 +99,11 @@ rm -rf %{buildroot}
%changelog
* Wed Dec 30 2020 lifeng <lifeng68@huawei.com> - 2.0.5-20201230.150203.git5e91f13f
- Type:update to v2.0.5
- ID:NA
- SUG:NA
* Thu Dec 3 2020 haozi007 <liuhao27@huawei.com> - 2.0.4-20201203.185548.gitcc470dc1
- Type:update from master
- ID:NA

Binary file not shown.

BIN
v2.0.5.tar.gz Normal file

Binary file not shown.