combine ten similar submissions into one(0125-fix-clang-build-error.patch) and Upgrade from upstream

This commit is contained in:
武积超 2024-10-22 10:11:01 +08:00
parent e0de402ef8
commit 42a5c54593
34 changed files with 10445 additions and 304 deletions

View File

@ -0,0 +1,26 @@
From d6284e5e786e1407c2ce5ef098a39c154650bd38 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Wed, 12 Jun 2024 10:57:39 +0800
Subject: [PATCH 109/149] modify default registry mirrors in ci test
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
CI/test_cases/container_cases/test_data/daemon.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CI/test_cases/container_cases/test_data/daemon.json b/CI/test_cases/container_cases/test_data/daemon.json
index 2664c6b2..ab7d0360 100644
--- a/CI/test_cases/container_cases/test_data/daemon.json
+++ b/CI/test_cases/container_cases/test_data/daemon.json
@@ -24,7 +24,7 @@
"overlay2.override_kernel_check=true"
],
"registry-mirrors": [
- "docker.io"
+ "https://3laho3y3.mirror.aliyuncs.com"
],
"insecure-registries": [
],
--
2.25.1

View File

@ -0,0 +1,25 @@
From 5087d7501308660970aa9e7c12cf5be7a3d9b063 Mon Sep 17 00:00:00 2001
From: jikai <jikai11@huawei.com>
Date: Wed, 12 Jun 2024 15:20:17 +0000
Subject: [PATCH 110/149] add timestamp in PodSandboxStatu response
Signed-off-by: jikai <jikai11@huawei.com>
---
src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
index fa726e2c..2a458a6d 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
@@ -910,6 +910,7 @@ void PodSandboxManagerService::PodSandboxStatus(const std::string &podSandboxID,
for (auto &containerStatus : containerStatuses) {
*(reply->add_containers_statuses()) = *containerStatus;
}
+ reply->set_timestamp(util_get_now_time_nanos());
return;
}
--
2.25.1

View File

@ -0,0 +1,75 @@
From d0fd2c2bf87d7befaa8810a70d7eb2061664f02f Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Fri, 14 Jun 2024 09:55:28 +0800
Subject: [PATCH 111/149] bugfix for file param verify
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/cmd/isula/base/create.c | 19 +++++++++++++++++++
src/cmd/isula/images/load.c | 6 ++++++
2 files changed, 25 insertions(+)
diff --git a/src/cmd/isula/base/create.c b/src/cmd/isula/base/create.c
index 543b8fd6..b04dddb5 100644
--- a/src/cmd/isula/base/create.c
+++ b/src/cmd/isula/base/create.c
@@ -292,6 +292,12 @@ static int append_env_variables_to_conf(const char *env_file, isula_container_co
int ret = 0;
size_t file_size;
+ if (util_dir_exists(env_file)) {
+ COMMAND_ERROR("Env file is a directory: %s", env_file);
+ ret = -1;
+ goto out;
+ }
+
if (!util_file_exists(env_file)) {
COMMAND_ERROR("env file not exists: %s", env_file);
ret = -1;
@@ -427,6 +433,12 @@ static int append_labels_to_conf(const char *label_file, isula_container_config_
int ret = 0;
size_t file_size;
+ if (util_dir_exists(label_file)) {
+ COMMAND_ERROR("Label file is a directory: %s", label_file);
+ ret = -1;
+ goto out;
+ }
+
if (!util_file_exists(label_file)) {
COMMAND_ERROR("label file not exists: %s", label_file);
ret = -1;
@@ -2357,6 +2369,13 @@ static int create_check_env_target_file(const struct client_arguments *args)
ret = -1;
goto out;
}
+
+ if (util_dir_exists(env_path)) {
+ COMMAND_ERROR("Env target file is a directory: %s", env_path);
+ ret = -1;
+ goto out;
+ }
+
if (!util_file_exists(env_path)) {
goto out;
}
diff --git a/src/cmd/isula/images/load.c b/src/cmd/isula/images/load.c
index 314e5d5e..cb39dee7 100644
--- a/src/cmd/isula/images/load.c
+++ b/src/cmd/isula/images/load.c
@@ -162,6 +162,12 @@ int cmd_load_main(int argc, const char **argv)
g_cmd_load_args.file = file;
}
+ if (util_dir_exists(g_cmd_load_args.file)) {
+ COMMAND_ERROR("Load file is a directory: %s", g_cmd_load_args.file);
+ ret = -1;
+ exit(exit_code);
+ }
+
if (!util_file_exists(g_cmd_load_args.file)) {
COMMAND_ERROR("File %s is not exist", g_cmd_load_args.file);
exit(exit_code);
--
2.25.1

View File

@ -0,0 +1,26 @@
From 359a6673e01bef937adcc17f99ee94b67caca32e Mon Sep 17 00:00:00 2001
From: liuxu <liuxu156@huawei.com>
Date: Fri, 14 Jun 2024 17:12:58 +0800
Subject: [PATCH 112/149] bugfix:change cni log info
Signed-off-by: liuxu <liuxu156@huawei.com>
---
.../modules/network/cni_operator/libcni/invoke/libcni_exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/daemon/modules/network/cni_operator/libcni/invoke/libcni_exec.c b/src/daemon/modules/network/cni_operator/libcni/invoke/libcni_exec.c
index 74d6d74a..1e4a7138 100644
--- a/src/daemon/modules/network/cni_operator/libcni/invoke/libcni_exec.c
+++ b/src/daemon/modules/network/cni_operator/libcni/invoke/libcni_exec.c
@@ -247,7 +247,7 @@ static char *env_stringify(char *(*pargs)[2], size_t len)
bool invalid_arg = (pargs == NULL || len == 0);
if (invalid_arg) {
- ERROR("Invalid arguments");
+ DEBUG("Empty arguments");
return NULL;
}
--
2.25.1

View File

@ -0,0 +1,43 @@
From 0ae6244c6bfed229a46d300888977a4967e1d718 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Wed, 19 Jun 2024 09:50:51 +0800
Subject: [PATCH 113/149] move shutdown handle after init module
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/cmd/isulad/main.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/cmd/isulad/main.c b/src/cmd/isulad/main.c
index 3e2249d7..52ac3172 100644
--- a/src/cmd/isulad/main.c
+++ b/src/cmd/isulad/main.c
@@ -1669,11 +1669,6 @@ static int start_daemon_threads()
{
int ret = -1;
- if (new_shutdown_handler()) {
- ERROR("Create new shutdown handler thread failed");
- goto out;
- }
-
if (events_module_init() != 0) {
goto out;
}
@@ -1825,6 +1820,13 @@ int main(int argc, char **argv)
goto failure;
}
+ // after all modules are initialized, enable the shutdown handler to
+ // prevent shutdown handler from cleaning up incompletely initialized modules.
+ if (new_shutdown_handler()) {
+ ERROR("Create new shutdown handler thread failed");
+ goto failure;
+ }
+
#ifdef ENABLE_PLUGIN
if (start_plugin_manager()) {
ERROR("Failed to init plugin_manager");
--
2.25.1

View File

@ -0,0 +1,56 @@
From 701180b53d1c52376f753b94c5cf09987ae789b3 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Tue, 18 Jun 2024 16:02:25 +0800
Subject: [PATCH 114/149] bugfix for null pointer reference
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/daemon/entry/connect/grpc/grpc_service.cc | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/daemon/entry/connect/grpc/grpc_service.cc b/src/daemon/entry/connect/grpc/grpc_service.cc
index 1d8de922..300af082 100644
--- a/src/daemon/entry/connect/grpc/grpc_service.cc
+++ b/src/daemon/entry/connect/grpc/grpc_service.cc
@@ -100,7 +100,9 @@ public:
{
// Wait for the server to shutdown. Note that some other thread must be
// responsible for shutting down the server for this call to ever return.
- m_server->Wait();
+ if (m_server != nullptr) {
+ m_server->Wait();
+ }
// Wait for stream server to shutdown
m_criService.Wait();
@@ -109,7 +111,9 @@ public:
void Shutdown(void)
{
// call CRI to shutdown stream server, shutdown cri first to notify events thread to exit
- m_criService.Shutdown();
+ if (m_server != nullptr) {
+ m_server->Shutdown();
+ }
m_server->Shutdown();
@@ -242,10 +246,16 @@ int grpc_server_init(const struct service_arguments *args)
void grpc_server_wait(void)
{
+ if (g_grpcserver == nullptr) {
+ return;
+ }
g_grpcserver->Wait();
}
void grpc_server_shutdown(void)
{
+ if (g_grpcserver == nullptr) {
+ return;
+ }
g_grpcserver->Shutdown();
}
--
2.25.1

View File

@ -0,0 +1,33 @@
From 93b1df1a1d3fcf6d285102f3cc1f79e6241aa393 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Thu, 4 Jul 2024 10:58:38 +0800
Subject: [PATCH 115/149] bugfix for m_criService shutdown
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/daemon/entry/connect/grpc/grpc_service.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/daemon/entry/connect/grpc/grpc_service.cc b/src/daemon/entry/connect/grpc/grpc_service.cc
index 300af082..fb5ec3cb 100644
--- a/src/daemon/entry/connect/grpc/grpc_service.cc
+++ b/src/daemon/entry/connect/grpc/grpc_service.cc
@@ -111,12 +111,12 @@ public:
void Shutdown(void)
{
// call CRI to shutdown stream server, shutdown cri first to notify events thread to exit
+ m_criService.Shutdown();
+
if (m_server != nullptr) {
m_server->Shutdown();
}
-
- m_server->Shutdown();
-
+
// Shutdown daemon, this operation should remove socket file.
for (const auto &address : m_socketPath) {
if (address.find(UNIX_SOCKET_PREFIX) == 0) {
--
2.25.1

View File

@ -0,0 +1,54 @@
From c7cf33c432b3d9479b2fe365169d4b9a37cae8f7 Mon Sep 17 00:00:00 2001
From: jikai <jikai11@huawei.com>
Date: Tue, 9 Jul 2024 12:30:01 +0000
Subject: [PATCH 116/149] fix bug in ci test
Signed-off-by: jikai <jikai11@huawei.com>
---
CI/test_cases/container_cases/run.sh | 6 +++---
CI/test_cases/helpers.sh | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/CI/test_cases/container_cases/run.sh b/CI/test_cases/container_cases/run.sh
index 1bfd388b..ef04b547 100755
--- a/CI/test_cases/container_cases/run.sh
+++ b/CI/test_cases/container_cases/run.sh
@@ -26,9 +26,9 @@ source ../helpers.sh
function do_test_t()
{
tid=`isula run --runtime $1 -tid --name hostname busybox`
- chostname=`isula exec -it $tid hostname`
- clean_hostname=$(echo "$hostname" | sed 's/[\x01-\x1F\x7F]//g')
- fn_check_eq "${clean_hostname}" "${tid:0:12}" "default hostname is not id of container"
+ # should not use -it option, otherwise the hostname will containe special characters such as '$' or '\r'
+ hostname=`isula exec $tid hostname`
+ fn_check_eq "${hostname}" "${tid:0:12}" "default hostname is not id of container"
isula exec -it hostname env | grep HOSTNAME
fn_check_eq "$?" "0" "check HOSTNAME env failed"
isula stop -t 0 $tid
diff --git a/CI/test_cases/helpers.sh b/CI/test_cases/helpers.sh
index c5eba8a2..0288b4ea 100755
--- a/CI/test_cases/helpers.sh
+++ b/CI/test_cases/helpers.sh
@@ -52,15 +52,16 @@ function cut_output_lines() {
return $retval
}
+# use string compare to check the result
function fn_check_eq() {
- if [[ "$1" -ne "$2" ]];then
+ if [ "x$1" != "x$2" ];then
echo "$3"
TC_RET_T=$(($TC_RET_T+1))
fi
}
function fn_check_ne() {
- if [[ "$1" -eq "$2" ]];then
+ if [[ "x$1" == "x$2" ]];then
echo "$3"
TC_RET_T=$(($TC_RET_T+1))
fi
--
2.25.1

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,51 @@
From ee720f966fdf14a99b8ebc685f3948bb8b29ba73 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Tue, 13 Aug 2024 10:56:44 +0800
Subject: [PATCH 119/149] skip calling cni plugin cleanup when network
namespace is not mounted
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
.../entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc | 7 +++++++
.../entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
index 2a458a6d..77faf48a 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
@@ -435,6 +435,13 @@ void PodSandboxManagerService::ClearCniNetwork(const std::shared_ptr<sandbox::Sa
return;
}
+ // If the network namespace is not mounted, the network has been cleaned up
+ // and there is no need to call the cni plugin.
+ if (!util_detect_mounted(sandboxKey.c_str())) {
+ WARN("Network namespace %s not exist", sandboxKey.c_str());
+ return;
+ }
+
const auto config = sandbox->GetSandboxConfig();
std::map<std::string, std::string> stdAnnos;
CRIHelpers::ProtobufAnnoMapToStd(config.annotations(), stdAnnos);
diff --git a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
index bc3f4031..5590827e 100644
--- a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
@@ -848,6 +848,13 @@ auto PodSandboxManagerService::ClearCniNetwork(const std::string &realSandboxID,
goto cleanup;
}
+ // If the network namespace is not mounted, the network has been cleaned up
+ // and there is no need to call the cni plugin.
+ if (!util_detect_mounted(netnsPath.c_str())) {
+ WARN("Network namespace %s not exist", netnsPath.c_str());
+ goto cleanup;
+ }
+
stdAnnos.insert(std::pair<std::string, std::string>(CRIHelpers::Constants::POD_SANDBOX_KEY, netnsPath));
pluginErr.Clear();
m_pluginManager->TearDownPod(ns, name, Network::DEFAULT_NETWORK_INTERFACE_NAME, realSandboxID, stdAnnos,
--
2.25.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,72 @@
From 6357caaf6bcf413b58e587fe3df5c508275713ee Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Thu, 15 Aug 2024 19:21:19 +1400
Subject: [PATCH 121/149] get realpath before ns mountpoint verification
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
.../entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc | 9 +++++++--
.../entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc | 9 +++++++--
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
index 77faf48a..3ece885f 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
@@ -424,6 +424,7 @@ cleanup_sandbox:
void PodSandboxManagerService::ClearCniNetwork(const std::shared_ptr<sandbox::Sandbox> sandbox, Errors &error)
{
+ char real_path[PATH_MAX] = { 0 };
std::string networkMode = sandbox->GetNetMode();
if (!namespace_is_cni(networkMode.c_str()) || !sandbox->GetNetworkReady()) {
return;
@@ -435,10 +436,14 @@ void PodSandboxManagerService::ClearCniNetwork(const std::shared_ptr<sandbox::Sa
return;
}
+ if (realpath(sandboxKey.c_str(), real_path) == NULL) {
+ ERROR("Failed to get %s realpath", sandboxKey.c_str());
+ }
+
// If the network namespace is not mounted, the network has been cleaned up
// and there is no need to call the cni plugin.
- if (!util_detect_mounted(sandboxKey.c_str())) {
- WARN("Network namespace %s not exist", sandboxKey.c_str());
+ if (strlen(real_path) != 0 && !util_detect_mounted(real_path)) {
+ ERROR("Network namespace %s not exist", real_path);
return;
}
diff --git a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
index 5590827e..1c343cda 100644
--- a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
@@ -826,6 +826,7 @@ auto PodSandboxManagerService::ClearCniNetwork(const std::string &realSandboxID,
/*error*/) -> int
{
Errors networkErr;
+ char real_path[PATH_MAX] = { 0 };
bool ready = GetNetworkReady(realSandboxID, networkErr);
if (hostNetwork || (!ready && networkErr.Empty())) {
@@ -848,10 +849,14 @@ auto PodSandboxManagerService::ClearCniNetwork(const std::string &realSandboxID,
goto cleanup;
}
+ if (realpath(netnsPath.c_str(), real_path) == NULL) {
+ ERROR("Failed to get %s realpath", netnsPath.c_str());
+ }
+
// If the network namespace is not mounted, the network has been cleaned up
// and there is no need to call the cni plugin.
- if (!util_detect_mounted(netnsPath.c_str())) {
- WARN("Network namespace %s not exist", netnsPath.c_str());
+ if (strlen(real_path) != 0 && !util_detect_mounted(real_path)) {
+ ERROR("Network namespace %s not exist", real_path);
goto cleanup;
}
--
2.25.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,287 @@
From 8e442712354a9d4f766d1f90b018fd1246cb9ef2 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Wed, 4 Sep 2024 16:26:59 +1400
Subject: [PATCH 123/149] code improve for codecheck
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/daemon/common/sysinfo.h | 8 ++++----
src/daemon/entry/cri/network_plugin.cc | 2 +-
src/daemon/mailbox/message_queue.h | 8 ++++----
src/daemon/mailbox/message_subscriber.h | 8 ++++++++
src/daemon/modules/runtime/shim/shim_rt_monitor.cc | 2 ++
src/daemon/nri/nri_adaption.h | 1 -
src/daemon/sandbox/sandbox_manager.cc | 5 ++---
src/utils/cutils/blocking_queue.h | 2 +-
src/utils/cutils/utils_aes.h | 2 +-
src/utils/cutils/utils_cap.h | 7 +++----
src/utils/cutils/utils_fs.h | 2 +-
src/utils/cutils/utils_network.c | 2 ++
src/utils/cutils/utils_string.h | 3 +--
src/utils/tar/util_archive.h | 5 ++---
src/utils/tar/util_gzip.h | 2 +-
15 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/src/daemon/common/sysinfo.h b/src/daemon/common/sysinfo.h
index 6142487b..e6bb7f95 100644
--- a/src/daemon/common/sysinfo.h
+++ b/src/daemon/common/sysinfo.h
@@ -15,16 +15,16 @@
#ifndef DAEMON_COMMON_SYSINFO_H
#define DAEMON_COMMON_SYSINFO_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
#include <stdint.h>
#include <isula_libutils/auto_cleanup.h>
#include "cgroup.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
// Number of processors currently online (i.e., available).
int ncpus;
diff --git a/src/daemon/entry/cri/network_plugin.cc b/src/daemon/entry/cri/network_plugin.cc
index f8f9c7e6..439d0224 100644
--- a/src/daemon/entry/cri/network_plugin.cc
+++ b/src/daemon/entry/cri/network_plugin.cc
@@ -198,7 +198,7 @@ void InitNetworkPlugin(std::vector<std::shared_ptr<NetworkPlugin>> *plugins, std
if (networkPluginName.empty()) {
DEBUG("network plugin name empty");
- *result = std::shared_ptr<NetworkPlugin>(new (std::nothrow) NoopNetworkPlugin);
+ *result = std::make_shared<NoopNetworkPlugin>();
if (*result == nullptr) {
ERROR("Out of memory");
return;
diff --git a/src/daemon/mailbox/message_queue.h b/src/daemon/mailbox/message_queue.h
index 7905840f..c9bbc9e2 100644
--- a/src/daemon/mailbox/message_queue.h
+++ b/src/daemon/mailbox/message_queue.h
@@ -16,10 +16,6 @@
#ifndef DAEMON_MESSAGE_MESSAGE_QUEUE_H
#define DAEMON_MESSAGE_MESSAGE_QUEUE_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <pthread.h>
#include "blocking_queue.h"
@@ -27,6 +23,10 @@ extern "C" {
#include "map.h"
#include "message_subscriber.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct message_queue {
blocking_queue *messages;
diff --git a/src/daemon/mailbox/message_subscriber.h b/src/daemon/mailbox/message_subscriber.h
index de4574d9..2987b60d 100644
--- a/src/daemon/mailbox/message_subscriber.h
+++ b/src/daemon/mailbox/message_subscriber.h
@@ -19,6 +19,10 @@
#include "blocking_queue.h"
#include "mailbox_message.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
blocking_queue *queue;
} message_subscriber;
@@ -38,4 +42,8 @@ define_auto_cleanup_callback(message_subscriber_destroy, message_subscriber);
// define auto free macro for blocking queue
#define __isula_auto_subscriber auto_cleanup_tag(message_subscriber_destroy)
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/daemon/modules/runtime/shim/shim_rt_monitor.cc b/src/daemon/modules/runtime/shim/shim_rt_monitor.cc
index 2547a206..97f5cd68 100644
--- a/src/daemon/modules/runtime/shim/shim_rt_monitor.cc
+++ b/src/daemon/modules/runtime/shim/shim_rt_monitor.cc
@@ -30,6 +30,8 @@
#include "utils.h"
#include "error.h"
+// The shim v2 header file needs to be modified to
+// use extern "C" to wrap external functions.
extern "C" {
#include <shim_v2.h>
}
diff --git a/src/daemon/nri/nri_adaption.h b/src/daemon/nri/nri_adaption.h
index 27a6d93e..6bd41941 100644
--- a/src/daemon/nri/nri_adaption.h
+++ b/src/daemon/nri/nri_adaption.h
@@ -16,7 +16,6 @@
#ifndef DAEMON_NRI_PLUGIN_NRI_ADAPTION_H
#define DAEMON_NRI_PLUGIN_NRI_ADAPTION_H
-// #include "read_write_lock.h"
#include <isula_libutils/nri_update_containers_request.h>
#include <isula_libutils/nri_update_containers_response.h>
diff --git a/src/daemon/sandbox/sandbox_manager.cc b/src/daemon/sandbox/sandbox_manager.cc
index cee444f4..4159993f 100644
--- a/src/daemon/sandbox/sandbox_manager.cc
+++ b/src/daemon/sandbox/sandbox_manager.cc
@@ -109,8 +109,7 @@ auto SandboxManager::CreateSandbox(const std::string &name, RuntimeInfo &info, s
return nullptr;
}
- sandbox = std::shared_ptr<Sandbox>(new Sandbox(id, m_rootdir, m_statedir, name, info, netMode, netNsPath,
- sandboxConfig, image));
+ sandbox = std::make_shared<Sandbox>(id, m_rootdir, m_statedir, name, info, netMode, netNsPath, sandboxConfig, image);
if (sandbox == nullptr) {
ERROR("Failed to malloc for sandbox: %s", name.c_str());
error.Errorf("Failed to malloc for sandbox: %s", name.c_str());
@@ -452,7 +451,7 @@ auto SandboxManager::LoadSandbox(std::string &id) -> std::shared_ptr<Sandbox>
return nullptr;
}
- sandbox = std::shared_ptr<Sandbox>(new Sandbox(id, m_rootdir, m_statedir));
+ sandbox = std::make_shared<Sandbox>(id, m_rootdir, m_statedir);
if (sandbox == nullptr) {
ERROR("Failed to malloc for sandboxes: %s", id.c_str());
return nullptr;
diff --git a/src/utils/cutils/blocking_queue.h b/src/utils/cutils/blocking_queue.h
index 257779c3..e6931501 100644
--- a/src/utils/cutils/blocking_queue.h
+++ b/src/utils/cutils/blocking_queue.h
@@ -26,7 +26,7 @@
extern "C" {
#endif
-#define BLOCKING_QUEUE_NO_TIMEOUT -1
+#define BLOCKING_QUEUE_NO_TIMEOUT (-1)
typedef struct blocking_node {
void *data;
diff --git a/src/utils/cutils/utils_aes.h b/src/utils/cutils/utils_aes.h
index bd2c2065..8ff6dad8 100644
--- a/src/utils/cutils/utils_aes.h
+++ b/src/utils/cutils/utils_aes.h
@@ -26,7 +26,7 @@ extern "C" {
#define AES_256_CFB_KEY_LEN 32
#define AES_256_CFB_IV_LEN 16
-int util_aes_key(const char *key_path, bool create, unsigned char *aeskey);
+int util_aes_key(const char *key_file, bool create, unsigned char *aeskey);
// note: Input bytes is "IV+data", "bytes+AES_256_CFB_IV_LEN" is the real data to be encoded.
// The output length is the input "len" and add the '\0' after end of the length.
diff --git a/src/utils/cutils/utils_cap.h b/src/utils/cutils/utils_cap.h
index de63d070..c7e78ac2 100644
--- a/src/utils/cutils/utils_cap.h
+++ b/src/utils/cutils/utils_cap.h
@@ -16,14 +16,13 @@
#ifndef UTILS_CUTILS_UTILS_CAP_H
#define UTILS_CUTILS_UTILS_CAP_H
+#include <stdbool.h>
+#include <stddef.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdbool.h>
-#include <stddef.h>
-#include <linux/capability.h>
-
bool util_valid_cap(const char *cap);
/**
diff --git a/src/utils/cutils/utils_fs.h b/src/utils/cutils/utils_fs.h
index c44fed8c..438af416 100644
--- a/src/utils/cutils/utils_fs.h
+++ b/src/utils/cutils/utils_fs.h
@@ -34,7 +34,7 @@ bool util_detect_mounted(const char *path);
int util_ensure_mounted_as(const char *dst, const char *mntopts);
int util_mount_from(const char *base, const char *src, const char *dst, const char *mtype, const char *mntopts);
typedef int (*mount_info_call_back_t)(const char *, const char *);
-bool util_deal_with_mount_info(mount_info_call_back_t cb, const char *);
+bool util_deal_with_mount_info(mount_info_call_back_t cb, const char *pattern);
bool util_check_readonly_fs(const char *path);
#ifdef __cplusplus
}
diff --git a/src/utils/cutils/utils_network.c b/src/utils/cutils/utils_network.c
index bb6a2f87..be33ec87 100644
--- a/src/utils/cutils/utils_network.c
+++ b/src/utils/cutils/utils_network.c
@@ -801,6 +801,8 @@ static bool is_invalid_char(char c)
return true;
case ' ':
return true;
+ default:
+ return false;
}
return false;
}
diff --git a/src/utils/cutils/utils_string.h b/src/utils/cutils/utils_string.h
index 0de2266c..d37343d5 100644
--- a/src/utils/cutils/utils_string.h
+++ b/src/utils/cutils/utils_string.h
@@ -17,7 +17,6 @@
#define UTILS_CUTILS_UTILS_STRING_H
#include <stdbool.h>
#include <stddef.h>
-#include <stdint.h>
#include <sys/types.h>
#ifdef __cplusplus
@@ -48,7 +47,7 @@ char **util_string_split(const char *src_str, char _sep);
// note that every delimiter bytes is considered to be a single delimiter
char **util_string_split_multi(const char *src_str, char delim);
-char **util_string_split_n(const char *src_str, char delim, size_t n);
+char **util_string_split_n(const char *src, char sep, size_t n);
const char *util_str_skip_str(const char *str, const char *skip);
diff --git a/src/utils/tar/util_archive.h b/src/utils/tar/util_archive.h
index 8f0ab2a4..98597d53 100644
--- a/src/utils/tar/util_archive.h
+++ b/src/utils/tar/util_archive.h
@@ -53,9 +53,8 @@ int archive_chroot_tar(const char *path, const char *file, const char *root_dir,
int archive_chroot_tar_stream(const char *chroot_dir, const char *tar_path, const char *src_base,
const char *dst_base, const char *root_dir, struct io_read_wrapper *content);
-int archive_chroot_untar_stream(const struct io_read_wrapper *content, const char *chroot_dir,
- const char *untar_dir, const char *src_base, const char *dst_base,
- const char *root_dir, char **errmsg);
+int archive_chroot_untar_stream(const struct io_read_wrapper *context, const char *chroot_dir, const char *untar_dir,
+ const char *src_base, const char *dst_base, const char *root_dir, char **errmsg);
int archive_copy_oci_tar_split_and_ret_size(int src_fd, const char *dist_file, int64_t *ret_size);
diff --git a/src/utils/tar/util_gzip.h b/src/utils/tar/util_gzip.h
index 7d881e92..7797c5f9 100644
--- a/src/utils/tar/util_gzip.h
+++ b/src/utils/tar/util_gzip.h
@@ -26,7 +26,7 @@ extern "C" {
int util_gzip_z(const char *srcfile, const char *dstfile, const mode_t mode);
// Decompress
-int util_gzip_d(const char *srcfile, const FILE *destfp);
+int util_gzip_d(const char *srcfile, const FILE *dstfp);
/*
* compress file.
--
2.25.1

View File

@ -0,0 +1,137 @@
From d6f7f7d3e2d644d2208ccc35f1de225b54c452a7 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Fri, 6 Sep 2024 17:45:58 +0800
Subject: [PATCH 124/149] change pull registry to hub.oepkgs.net
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
CI/make-and-install.sh | 4 ++--
.../container_cases/test_data/daemon.json | 2 +-
CI/test_cases/image_cases/image_digest.sh | 6 ++---
CI/test_cases/image_cases/image_search.sh | 2 +-
CI/test_cases/image_cases/registry.sh | 22 +++++++++----------
5 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/CI/make-and-install.sh b/CI/make-and-install.sh
index 61281965..2c2a4241 100755
--- a/CI/make-and-install.sh
+++ b/CI/make-and-install.sh
@@ -95,7 +95,7 @@ cmake -DLIB_INSTALL_DIR=${restbuilddir}/lib -DCMAKE_INSTALL_PREFIX=${restbuilddi
make -j $(nproc)
make install
sed -i 's/"log-driver": "stdout"/"log-driver": "file"/g' ${restbuilddir}/etc/isulad/daemon.json
-sed -i "/registry-mirrors/a\ \"https://3laho3y3.mirror.aliyuncs.com\"" ${restbuilddir}/etc/isulad/daemon.json
+sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\"" ${restbuilddir}/etc/isulad/daemon.json
#build grpc version
cd $ISULAD_COPY_PATH
@@ -110,4 +110,4 @@ fi
make -j $(nproc)
make install
sed -i 's/"log-driver": "stdout"/"log-driver": "file"/g' ${builddir}/etc/isulad/daemon.json
-sed -i "/registry-mirrors/a\ \"https://3laho3y3.mirror.aliyuncs.com\"" ${builddir}/etc/isulad/daemon.json
+sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\"" ${builddir}/etc/isulad/daemon.json
diff --git a/CI/test_cases/container_cases/test_data/daemon.json b/CI/test_cases/container_cases/test_data/daemon.json
index ab7d0360..20b001c0 100644
--- a/CI/test_cases/container_cases/test_data/daemon.json
+++ b/CI/test_cases/container_cases/test_data/daemon.json
@@ -24,7 +24,7 @@
"overlay2.override_kernel_check=true"
],
"registry-mirrors": [
- "https://3laho3y3.mirror.aliyuncs.com"
+ "https://hub.oepkgs.net"
],
"insecure-registries": [
],
diff --git a/CI/test_cases/image_cases/image_digest.sh b/CI/test_cases/image_cases/image_digest.sh
index cc8b0e48..20774e07 100755
--- a/CI/test_cases/image_cases/image_digest.sh
+++ b/CI/test_cases/image_cases/image_digest.sh
@@ -25,9 +25,9 @@ source ../helpers.sh
function test_image_with_digest()
{
local ret=0
- local image="3laho3y3.mirror.aliyuncs.com/library/busybox"
- local image2="3laho3y3.mirror.aliyuncs.com/library/ubuntu"
- local image_digest="3laho3y3.mirror.aliyuncs.com/library/busybox@sha256:62ffc2ed7554e4c6d360bce40bbcf196573dd27c4ce080641a2c59867e732dee"
+ local image="hub.oepkgs.net/library/busybox"
+ local image2="hub.oepkgs.net/library/ubuntu"
+ local image_digest="hub.oepkgs.net/library/busybox@sha256:6066ca124f8c2686b7ae71aa1d6583b28c6dc3df3bdc386f2c89b92162c597d9"
local test="pull && inspect && tag image with digest test => (${FUNCNAME[@]})"
msg_info "${test} starting..."
diff --git a/CI/test_cases/image_cases/image_search.sh b/CI/test_cases/image_cases/image_search.sh
index 4bf0e099..9ac680ce 100755
--- a/CI/test_cases/image_cases/image_search.sh
+++ b/CI/test_cases/image_cases/image_search.sh
@@ -77,7 +77,7 @@ function test_image_search()
declare -i ans=0
# unable to pull image from docker.io without agent, skip this test
-# registry API v1 is not implemented in https://3laho3y3.mirror.aliyuncs.com and isula search cannot be tested
+# registry API v1 is not implemented in https://hub.oepkgs.net and isula search cannot be tested
# test_image_search || ((ans++))
show_result ${ans} "${curr_path}/${0}"
diff --git a/CI/test_cases/image_cases/registry.sh b/CI/test_cases/image_cases/registry.sh
index 7ea9a0c5..e56d99d3 100755
--- a/CI/test_cases/image_cases/registry.sh
+++ b/CI/test_cases/image_cases/registry.sh
@@ -78,8 +78,8 @@ function isula_pull()
# isula pull docker.io/library/busybox:latest
# [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - --pull docker.io/library/busybox:latest failed" && ((ret++))
- isula pull 3laho3y3.mirror.aliyuncs.com/library/busybox
- fn_check_eq "$?" "0" "isula pull 3laho3y3.mirror.aliyuncs.com/library/busybox"
+ isula pull hub.oepkgs.net/library/busybox
+ fn_check_eq "$?" "0" "isula pull hub.oepkgs.net/library/busybox"
rm -f /etc/isulad/daemon.json.bak
cp /etc/isulad/daemon.json /etc/isulad/daemon.json.bak
@@ -98,7 +98,7 @@ function isula_pull()
cp /etc/isulad/daemon.json.bak /etc/isulad/daemon.json
rm -f /etc/isulad/daemon.json.bak
- isula rmi 3laho3y3.mirror.aliyuncs.com/library/busybox
+ isula rmi hub.oepkgs.net/library/busybox
check_valgrind_log
fn_check_eq "$?" "0" "stop isulad with check valgrind"
@@ -109,12 +109,12 @@ function isula_pull()
function isula_login()
{
- isula login -u test -p test 3laho3y3.mirror.aliyuncs.com
- fn_check_eq "$?" "0" "isula login -u test -p test 3laho3y3.mirror.aliyuncs.com"
+ isula login -u isulaci -p iSula123 hub.oepkgs.net
+ fn_check_eq "$?" "0" "isula login -u isulaci -p iSula123 hub.oepkgs.net"
# double login for memory leak check
- isula login -u test -p test 3laho3y3.mirror.aliyuncs.com
- fn_check_eq "$?" "0" "isula login -u test -p test 3laho3y3.mirror.aliyuncs.com"
+ isula login -u isulaci -p iSula123 hub.oepkgs.net
+ fn_check_eq "$?" "0" "isula login -u isulaci -p iSula123 hub.oepkgs.net"
# use username/password to pull busybox for memmory leak check
isula pull busybox
@@ -123,12 +123,12 @@ function isula_login()
function isula_logout()
{
- isula logout 3laho3y3.mirror.aliyuncs.com
- fn_check_eq "$?" "0" "isula logout 3laho3y3.mirror.aliyuncs.com"
+ isula logout hub.oepkgs.net
+ fn_check_eq "$?" "0" "isula logout hub.oepkgs.net"
# double logout for memory leak check
- isula logout 3laho3y3.mirror.aliyuncs.com
- fn_check_eq "$?" "0" "isula logout 3laho3y3.mirror.aliyuncs.com"
+ isula logout hub.oepkgs.net
+ fn_check_eq "$?" "0" "isula logout hub.oepkgs.net"
}
function do_test_t()
--
2.25.1

View File

@ -1,265 +1,23 @@
From 5729e26c3d57922cfb449cac04eb74d51b5f9c3a Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 30 Aug 2024 01:17:01 +0800
Subject: [PATCH 1/8] move cri_stream_server_url out of extern C in stream_server.h
From d141d8bfc7a602b0f139bef42a1c73dc673687de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AD=A6=E7=A7=AF=E8=B6=85?= <wujichao1@huawei.com>
Date: Mon, 21 Oct 2024 19:39:38 +0800
Subject: [PATCH] fix-clang-build-error
---
src/daemon/entry/cri/streams/stream_server.h | 8 --------
1 file changed, 8 deletions(-)
diff --git a/src/daemon/entry/cri/streams/stream_server.h b/src/daemon/entry/cri/streams/stream_server.h
index 81aa998..9a7fccb 100644
--- a/src/daemon/entry/cri/streams/stream_server.h
+++ b/src/daemon/entry/cri/streams/stream_server.h
@@ -17,6 +17,8 @@
#include "errors.h"
#include "url.h"
+url::URLDatum cri_stream_server_url(void);
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -27,8 +29,6 @@ void cri_stream_server_wait(void);
void cri_stream_server_shutdown(void);
-url::URLDatum cri_stream_server_url(void);
-
#ifdef __cplusplus
}
#endif
--
2.43.0
From c21d5b4ae5fc7d1b1c70cddfc9c52449e99607c8 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 30 Aug 2024 01:33:15 +0800
Subject: [PATCH 2/8] fix unqualified call to 'std::move'
---
src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc | 2 +-
src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc | 2 +-
src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc | 4 ++--
src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc | 2 +-
.../entry/cri/v1alpha/cri_image_manager_service_impl.cc | 2 +-
.../entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc | 4 ++--
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
index 1cee68e..86688a1 100644
--- a/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
@@ -690,7 +690,7 @@ void ContainerManagerService::ListContainersToGRPC(container_list_response *resp
CRIHelpersV1::ContainerStatusToRuntime(Container_Status(response->containers[i]->status));
container->set_state(state);
- containers.push_back(move(container));
+ containers.push_back(std::move(container));
}
}
diff --git a/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc b/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc
index 7191870..561a40d 100644
--- a/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc
@@ -149,7 +149,7 @@ void ImageManagerServiceImpl::list_images_to_grpc(im_list_response *response,
imagetool_image_summary *element = list_images->images[i];
conv_image_to_grpc(element, image);
- images.push_back(move(image));
+ images.push_back(std::move(image));
}
}
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
index fa726e2..f929e0e 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
@@ -1170,7 +1170,7 @@ void PodSandboxManagerService::PodSandboxStatsToGRPC(const std::string &id, cons
return;
}
- podStats = move(podStatsPtr);
+ podStats = std::move(podStatsPtr);
return;
}
@@ -1320,7 +1320,7 @@ void PodSandboxManagerService::ListPodSandboxStats(const runtime::v1::PodSandbox
continue;
}
- podsStats.push_back(move(podStats));
+ podsStats.push_back(std::move(podStats));
}
}
diff --git a/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc
index dbefa14..97acecd 100644
--- a/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc
@@ -687,7 +687,7 @@ void ContainerManagerService::ListContainersToGRPC(container_list_response *resp
CRIHelpersV1Alpha::ContainerStatusToRuntime(Container_Status(response->containers[i]->status));
container->set_state(state);
- pods.push_back(move(container));
+ pods.push_back(std::move(container));
}
}
diff --git a/src/daemon/entry/cri/v1alpha/cri_image_manager_service_impl.cc b/src/daemon/entry/cri/v1alpha/cri_image_manager_service_impl.cc
index cf63642..a14dc62 100644
--- a/src/daemon/entry/cri/v1alpha/cri_image_manager_service_impl.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_image_manager_service_impl.cc
@@ -149,7 +149,7 @@ void ImageManagerServiceImpl::list_images_to_grpc(im_list_response *response,
imagetool_image_summary *element = list_images->images[i];
conv_image_to_grpc(element, image);
- images.push_back(move(image));
+ images.push_back(std::move(image));
}
}
diff --git a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
index bc3f403..591f74a 100644
--- a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
@@ -1561,7 +1561,7 @@ void PodSandboxManagerService::PodSandboxStatsToGRPC(const std::string &id, cons
return;
}
- podStats = move(podStatsPtr);
+ podStats = std::move(podStatsPtr);
return;
}
@@ -1721,7 +1721,7 @@ void PodSandboxManagerService::ListPodSandboxStats(const runtime::v1alpha2::PodS
continue;
}
- podsStats.push_back(move(podStats));
+ podsStats.push_back(std::move(podStats));
}
}
--
2.43.0
From 8d8ee818c0a557db793e5c9660594a08f7e6a09f Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 30 Aug 2024 01:34:49 +0800
Subject: [PATCH 3/8] fix 'format string is not a string literal (potentially
insecure)'
---
src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
index f929e0e..7cae705 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
@@ -505,7 +505,7 @@ auto PodSandboxManagerService::GetContainerListResponse(const std::string &readS
if (CRIHelpers::FiltersAddLabel(list_request->filters, CRIHelpers::Constants::SANDBOX_ID_LABEL_KEY,
readSandboxID) != 0) {
std::string tmp_errmsg = "Failed to add label in sandbox" + readSandboxID;
- ERROR(tmp_errmsg.c_str());
+ ERROR("%s", tmp_errmsg.c_str());
errors.push_back(tmp_errmsg);
return nullptr;
}
@@ -520,7 +520,7 @@ auto PodSandboxManagerService::GetContainerListResponse(const std::string &readS
}
if (ret != 0) {
if (list_response != nullptr && list_response->errmsg != nullptr) {
- ERROR(list_response->errmsg);
+ ERROR("%s", list_response->errmsg);
errors.push_back(list_response->errmsg);
} else {
ERROR("Failed to call list container callback");
--
2.43.0
From 483064dbb18a7febea53d5558cbd633d4845279b Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 30 Aug 2024 01:35:58 +0800
Subject: [PATCH 4/8] fix braces around initialization of subobject
---
src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc | 2 +-
src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
index 7cae705..9240894 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
@@ -1179,7 +1179,7 @@ auto PodSandboxManagerService::PodSandboxStats(const std::string &podSandboxID,
Errors &error) -> std::unique_ptr<runtime::v1::PodSandboxStats>
{
Errors tmpErr;
- cgroup_metrics_t cgroupMetrics { 0 };
+ cgroup_metrics_t cgroupMetrics {{ 0 }};
std::vector<Network::NetworkInterfaceStats> netMetrics;
std::map<std::string, std::string> annotations;
std::unique_ptr<runtime::v1::PodSandboxStats> podStats { nullptr };
diff --git a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
index 591f74a..b71e3fc 100644
--- a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
@@ -1571,7 +1571,7 @@ auto PodSandboxManagerService::PodSandboxStats(const std::string &podSandboxID,
{
Errors tmpErr;
container_inspect *inspectData { nullptr };
- cgroup_metrics_t cgroupMetrics { 0 };
+ cgroup_metrics_t cgroupMetrics {{ 0 }};
std::vector<Network::NetworkInterfaceStats> netMetrics;
std::map<std::string, std::string> annotations;
std::unique_ptr<runtime::v1alpha2::PodSandboxStats> podStats { nullptr };
--
2.43.0
From cb19526803a2ad5d60a6dee7e6b32998cc75fc10 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 30 Aug 2024 01:37:07 +0800
Subject: [PATCH 5/8] fix 'private field 'm_enablePodEvents' is not used'
---
src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
index 3d93c7b..9be378f 100644
--- a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
+++ b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
@@ -104,7 +104,7 @@ protected:
private:
std::string m_podSandboxImage;
std::shared_ptr<Network::PluginManager> m_pluginManager { nullptr };
- bool m_enablePodEvents;
+ [[maybe_unused]]bool m_enablePodEvents;
};
} // namespace CRIV1
#endif // DAEMON_ENTRY_CRI_V1_CRI_RUNTIME_SERVICE_IMPL_H
--
2.43.0
From d8205b06e3cf58104d02bb153a202a512869e293 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 30 Aug 2024 01:44:15 +0800
Subject: [PATCH 6/8] fix passing std::string to variadic functions
---
src/daemon/common/cri/cri_helpers.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
src/daemon/common/cri/cri_helpers.cc | 4 ++--
src/daemon/entry/cri/streams/stream_server.h | 4 ++--
.../entry/cri/v1/v1_cri_container_manager_service.cc | 2 +-
.../entry/cri/v1/v1_cri_image_manager_service_impl.cc | 2 +-
.../entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc | 10 +++++-----
src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h | 2 +-
.../entry/cri/v1alpha/cri_container_manager_service.cc | 2 +-
.../cri/v1alpha/cri_pod_sandbox_manager_service.cc | 6 +++---
src/daemon/sandbox/sandbox.cc | 2 +-
src/daemon/sandbox/sandbox_ops.cc | 2 +-
10 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/daemon/common/cri/cri_helpers.cc b/src/daemon/common/cri/cri_helpers.cc
index 8117403..a8cbd99 100644
index 8117403c..a8cbd996 100644
--- a/src/daemon/common/cri/cri_helpers.cc
+++ b/src/daemon/common/cri/cri_helpers.cc
@@ -525,8 +525,8 @@ void RemoveContainerLogSymlink(const std::string &containerID, Errors &error)
@ -273,22 +31,175 @@ index 8117403..a8cbd99 100644
}
}
}
--
2.43.0
From 5ec6bd878249177f15bee5c7c43b6668fbf672f1 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 30 Aug 2024 01:44:24 +0800
Subject: [PATCH 7/8] remove unnecessary std::move for std::unique_ptr
initialization
---
src/daemon/sandbox/sandbox_ops.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/daemon/entry/cri/streams/stream_server.h b/src/daemon/entry/cri/streams/stream_server.h
index 81aa9987..028dfc84 100644
--- a/src/daemon/entry/cri/streams/stream_server.h
+++ b/src/daemon/entry/cri/streams/stream_server.h
@@ -17,6 +17,8 @@
#include "errors.h"
#include "url.h"
+url::URLDatum cri_stream_server_url(void);
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -27,8 +29,6 @@ void cri_stream_server_wait(void);
void cri_stream_server_shutdown(void);
-url::URLDatum cri_stream_server_url(void);
-
#ifdef __cplusplus
}
#endif
diff --git a/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
index d3fdd76a..1e84d14c 100644
--- a/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
@@ -744,7 +744,7 @@ void ContainerManagerService::ListContainersToGRPC(container_list_response *resp
CRIHelpersV1::ContainerStatusToRuntime(Container_Status(response->containers[i]->status));
container->set_state(state);
- containers.push_back(move(container));
+ containers.push_back(std::move(container));
}
}
diff --git a/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc b/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc
index 71918706..561a40d5 100644
--- a/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc
@@ -149,7 +149,7 @@ void ImageManagerServiceImpl::list_images_to_grpc(im_list_response *response,
imagetool_image_summary *element = list_images->images[i];
conv_image_to_grpc(element, image);
- images.push_back(move(image));
+ images.push_back(std::move(image));
}
}
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
index b629b1c3..a5f98619 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
@@ -536,7 +536,7 @@ auto PodSandboxManagerService::GetContainerListResponse(const std::string &readS
if (CRIHelpers::FiltersAddLabel(list_request->filters, CRIHelpers::Constants::SANDBOX_ID_LABEL_KEY,
readSandboxID) != 0) {
std::string tmp_errmsg = "Failed to add label in sandbox" + readSandboxID;
- ERROR(tmp_errmsg.c_str());
+ ERROR("%s", tmp_errmsg.c_str());
errors.push_back(tmp_errmsg);
return nullptr;
}
@@ -551,7 +551,7 @@ auto PodSandboxManagerService::GetContainerListResponse(const std::string &readS
}
if (ret != 0) {
if (list_response != nullptr && list_response->errmsg != nullptr) {
- ERROR(list_response->errmsg);
+ ERROR("%s", list_response->errmsg);
errors.push_back(list_response->errmsg);
} else {
ERROR("Failed to call list container callback");
@@ -1218,7 +1218,7 @@ void PodSandboxManagerService::PodSandboxStatsToGRPC(const std::string &id, cons
return;
}
- podStats = move(podStatsPtr);
+ podStats = std::move(podStatsPtr);
return;
}
@@ -1227,7 +1227,7 @@ auto PodSandboxManagerService::PodSandboxStats(const std::string &podSandboxID,
Errors &error) -> std::unique_ptr<runtime::v1::PodSandboxStats>
{
Errors tmpErr;
- cgroup_metrics_t cgroupMetrics { 0 };
+ cgroup_metrics_t cgroupMetrics {{ 0 }};
std::vector<Network::NetworkInterfaceStats> netMetrics;
std::map<std::string, std::string> annotations;
std::unique_ptr<runtime::v1::PodSandboxStats> podStats { nullptr };
@@ -1368,7 +1368,7 @@ void PodSandboxManagerService::ListPodSandboxStats(const runtime::v1::PodSandbox
continue;
}
- podsStats.push_back(move(podStats));
+ podsStats.push_back(std::move(podStats));
}
}
diff --git a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
index 3d93c7bb..33539a32 100644
--- a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
+++ b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
@@ -104,7 +104,7 @@ protected:
private:
std::string m_podSandboxImage;
std::shared_ptr<Network::PluginManager> m_pluginManager { nullptr };
- bool m_enablePodEvents;
+ [[maybe_unused]] bool m_enablePodEvents;
};
} // namespace CRIV1
#endif // DAEMON_ENTRY_CRI_V1_CRI_RUNTIME_SERVICE_IMPL_H
diff --git a/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc
index dbefa143..97acecd9 100644
--- a/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc
@@ -687,7 +687,7 @@ void ContainerManagerService::ListContainersToGRPC(container_list_response *resp
CRIHelpersV1Alpha::ContainerStatusToRuntime(Container_Status(response->containers[i]->status));
container->set_state(state);
- pods.push_back(move(container));
+ pods.push_back(std::move(container));
}
}
diff --git a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
index 1c343cda..3c128645 100644
--- a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
@@ -1573,7 +1573,7 @@ void PodSandboxManagerService::PodSandboxStatsToGRPC(const std::string &id, cons
return;
}
- podStats = move(podStatsPtr);
+ podStats = std::move(podStatsPtr);
return;
}
@@ -1583,7 +1583,7 @@ auto PodSandboxManagerService::PodSandboxStats(const std::string &podSandboxID,
{
Errors tmpErr;
container_inspect *inspectData { nullptr };
- cgroup_metrics_t cgroupMetrics { 0 };
+ cgroup_metrics_t cgroupMetrics {{ 0 }};
std::vector<Network::NetworkInterfaceStats> netMetrics;
std::map<std::string, std::string> annotations;
std::unique_ptr<runtime::v1alpha2::PodSandboxStats> podStats { nullptr };
@@ -1733,7 +1733,7 @@ void PodSandboxManagerService::ListPodSandboxStats(const runtime::v1alpha2::PodS
continue;
}
- podsStats.push_back(move(podStats));
+ podsStats.push_back(std::move(podStats));
}
}
diff --git a/src/daemon/sandbox/sandbox.cc b/src/daemon/sandbox/sandbox.cc
index d44abb99..dec082bc 100644
--- a/src/daemon/sandbox/sandbox.cc
+++ b/src/daemon/sandbox/sandbox.cc
@@ -847,7 +847,7 @@ auto Sandbox::SaveState(Errors &error) -> bool
nret = util_atomic_write_file(path.c_str(), stateJson.c_str(), stateJson.length(), CONFIG_FILE_MODE, false);
if (nret != 0) {
- SYSERROR("Failed to write file %s");
+ SYSERROR("Failed to write file %s", path.c_str());
error.Errorf("Failed to write file %s", path.c_str());
return false;
}
diff --git a/src/daemon/sandbox/sandbox_ops.cc b/src/daemon/sandbox/sandbox_ops.cc
index b7fb40b..22cfea9 100644
index b7fb40bf..22cfea95 100644
--- a/src/daemon/sandbox/sandbox_ops.cc
+++ b/src/daemon/sandbox/sandbox_ops.cc
@@ -72,7 +72,7 @@ static int do_sandbox_prepare(const container_config_v2_common_config *config,
@ -301,31 +212,5 @@ index b7fb40b..22cfea9 100644
if (generate_ctrl_rootfs(params, config) != 0) {
ERROR("Invalid rootfs");
--
2.43.0
From b3cdeb691b67e733d48254b8685c35a5fe450e78 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 30 Aug 2024 01:44:32 +0800
Subject: [PATCH 8/8] fix more '%' conversions than data arguments
---
src/daemon/sandbox/sandbox.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/daemon/sandbox/sandbox.cc b/src/daemon/sandbox/sandbox.cc
index d44abb9..dec082b 100644
--- a/src/daemon/sandbox/sandbox.cc
+++ b/src/daemon/sandbox/sandbox.cc
@@ -847,7 +847,7 @@ auto Sandbox::SaveState(Errors &error) -> bool
nret = util_atomic_write_file(path.c_str(), stateJson.c_str(), stateJson.length(), CONFIG_FILE_MODE, false);
if (nret != 0) {
- SYSERROR("Failed to write file %s");
+ SYSERROR("Failed to write file %s", path.c_str());
error.Errorf("Failed to write file %s", path.c_str());
return false;
}
--
2.43.0
2.25.1

View File

@ -0,0 +1,25 @@
From a7a851f5be6c37665d948ec7587de062b6295bbe Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Sat, 7 Sep 2024 11:24:44 +0800
Subject: [PATCH 133/149] add a new registry to prevent missing mirrors
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
CI/test_cases/container_cases/test_data/daemon.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/CI/test_cases/container_cases/test_data/daemon.json b/CI/test_cases/container_cases/test_data/daemon.json
index 20b001c0..cf7e0b9d 100644
--- a/CI/test_cases/container_cases/test_data/daemon.json
+++ b/CI/test_cases/container_cases/test_data/daemon.json
@@ -24,6 +24,7 @@
"overlay2.override_kernel_check=true"
],
"registry-mirrors": [
+ "https://docker.chenby.cn",
"https://hub.oepkgs.net"
],
"insecure-registries": [
--
2.25.1

View File

@ -0,0 +1,47 @@
From be8e1822b771576ef2f225da90dc6f0551477c0e Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Sat, 7 Sep 2024 14:49:33 +0800
Subject: [PATCH 134/149] change image digest ci test for registry change
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
CI/make-and-install.sh | 5 ++---
CI/test_cases/image_cases/image_digest.sh | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/CI/make-and-install.sh b/CI/make-and-install.sh
index 2c2a4241..599afcb9 100755
--- a/CI/make-and-install.sh
+++ b/CI/make-and-install.sh
@@ -95,7 +95,7 @@ cmake -DLIB_INSTALL_DIR=${restbuilddir}/lib -DCMAKE_INSTALL_PREFIX=${restbuilddi
make -j $(nproc)
make install
sed -i 's/"log-driver": "stdout"/"log-driver": "file"/g' ${restbuilddir}/etc/isulad/daemon.json
-sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\"" ${restbuilddir}/etc/isulad/daemon.json
+sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\",\\n \"https://docker.chenby.cn\"" ${builddir}/etc/isulad/daemon.json
#build grpc version
cd $ISULAD_COPY_PATH
@@ -109,5 +109,4 @@ else
fi
make -j $(nproc)
make install
-sed -i 's/"log-driver": "stdout"/"log-driver": "file"/g' ${builddir}/etc/isulad/daemon.json
-sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\"" ${builddir}/etc/isulad/daemon.json
+sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\",\\n \"https://docker.chenby.cn\"" ${builddir}/etc/isulad/daemon.json
diff --git a/CI/test_cases/image_cases/image_digest.sh b/CI/test_cases/image_cases/image_digest.sh
index 20774e07..ec1cbaa5 100755
--- a/CI/test_cases/image_cases/image_digest.sh
+++ b/CI/test_cases/image_cases/image_digest.sh
@@ -26,7 +26,7 @@ function test_image_with_digest()
{
local ret=0
local image="hub.oepkgs.net/library/busybox"
- local image2="hub.oepkgs.net/library/ubuntu"
+ local image2="ubuntu"
local image_digest="hub.oepkgs.net/library/busybox@sha256:6066ca124f8c2686b7ae71aa1d6583b28c6dc3df3bdc386f2c89b92162c597d9"
local test="pull && inspect && tag image with digest test => (${FUNCNAME[@]})"
--
2.25.1

View File

@ -0,0 +1,26 @@
From cc266a7c27cc40099f545b19d16fce49aee9a403 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Mon, 9 Sep 2024 10:51:43 +0800
Subject: [PATCH 135/149] bugfix for ci make and install shell
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
CI/make-and-install.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CI/make-and-install.sh b/CI/make-and-install.sh
index 599afcb9..1498d700 100755
--- a/CI/make-and-install.sh
+++ b/CI/make-and-install.sh
@@ -95,7 +95,7 @@ cmake -DLIB_INSTALL_DIR=${restbuilddir}/lib -DCMAKE_INSTALL_PREFIX=${restbuilddi
make -j $(nproc)
make install
sed -i 's/"log-driver": "stdout"/"log-driver": "file"/g' ${restbuilddir}/etc/isulad/daemon.json
-sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\",\\n \"https://docker.chenby.cn\"" ${builddir}/etc/isulad/daemon.json
+sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\",\\n \"https://docker.chenby.cn\"" ${restbuilddir}/etc/isulad/daemon.json
#build grpc version
cd $ISULAD_COPY_PATH
--
2.25.1

View File

@ -0,0 +1,28 @@
From 10af937fc2e095bce2da902c20e1f6b5e6178387 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Mon, 9 Sep 2024 17:18:52 +0800
Subject: [PATCH 136/149] do not use 1000 as the test gid to prevent conflicts
with existing gids in the image
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
CI/test_cases/container_cases/exec_additional_gids.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/CI/test_cases/container_cases/exec_additional_gids.sh b/CI/test_cases/container_cases/exec_additional_gids.sh
index 2edfd750..a62ab78c 100755
--- a/CI/test_cases/container_cases/exec_additional_gids.sh
+++ b/CI/test_cases/container_cases/exec_additional_gids.sh
@@ -25,7 +25,8 @@ source ../helpers.sh
test_log=$(mktemp /tmp/additional_gids_test_XXX)
USERNAME="user"
-USER_UID="1000"
+# Do not use 1000 as the test gid because "ubuntu:x:1000:" already exists in the ubuntu image
+USER_UID="1002"
USER_GID="$USER_UID"
ADDITIONAL_GID="1001"
ADDITIONAL_GROUP="additional"
--
2.25.1

View File

@ -0,0 +1,224 @@
From d77740f686c90861198498ac760f0bb8a5bcc593 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Tue, 10 Sep 2024 15:16:37 +0800
Subject: [PATCH 139/149] only use the openeuler mirror registry in ci
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
CI/make-and-install.sh | 4 ++--
CI/test_cases/container_cases/exec_additional_gids.sh | 3 ++-
CI/test_cases/container_cases/runc_exec.sh | 2 +-
CI/test_cases/image_cases/image_digest.sh | 2 +-
CI/test_cases/image_cases/image_load.sh | 8 +++++---
CI/test_cases/image_cases/image_tag.sh | 2 +-
CI/test_cases/image_cases/images_list.sh | 2 +-
CI/test_cases/image_cases/integration_check.sh | 2 +-
CI/test_cases/manual_cases/oom_monitor.sh | 4 ++--
CI/test_cases/manual_cases/security_selinux.sh | 6 +++---
10 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/CI/make-and-install.sh b/CI/make-and-install.sh
index 1498d700..09a68da6 100755
--- a/CI/make-and-install.sh
+++ b/CI/make-and-install.sh
@@ -95,7 +95,7 @@ cmake -DLIB_INSTALL_DIR=${restbuilddir}/lib -DCMAKE_INSTALL_PREFIX=${restbuilddi
make -j $(nproc)
make install
sed -i 's/"log-driver": "stdout"/"log-driver": "file"/g' ${restbuilddir}/etc/isulad/daemon.json
-sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\",\\n \"https://docker.chenby.cn\"" ${restbuilddir}/etc/isulad/daemon.json
+sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\"" ${restbuilddir}/etc/isulad/daemon.json
#build grpc version
cd $ISULAD_COPY_PATH
@@ -109,4 +109,4 @@ else
fi
make -j $(nproc)
make install
-sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\",\\n \"https://docker.chenby.cn\"" ${builddir}/etc/isulad/daemon.json
+sed -i "/registry-mirrors/a\ \"https://hub.oepkgs.net\"" ${builddir}/etc/isulad/daemon.json
\ No newline at end of file
diff --git a/CI/test_cases/container_cases/exec_additional_gids.sh b/CI/test_cases/container_cases/exec_additional_gids.sh
index a62ab78c..a5eaf652 100755
--- a/CI/test_cases/container_cases/exec_additional_gids.sh
+++ b/CI/test_cases/container_cases/exec_additional_gids.sh
@@ -38,13 +38,14 @@ function additional_gids_test()
{
local ret=0
local runtime=$1
+ local ubuntu_image="isulad/ubuntu"
test="exec additional gids test => test_exec_additional_gids => $runtime"
msg_info "${test} starting..."
isula rm -f `isula ps -a -q`
- isula run -tid --runtime $runtime -n $cont_name ubuntu bash
+ isula run -tid --runtime $runtime -n $cont_name ${ubuntu_image} bash
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to run container" && ((ret++))
isula exec $cont_name bash -c "groupadd --gid $USER_GID $USERNAME \
diff --git a/CI/test_cases/container_cases/runc_exec.sh b/CI/test_cases/container_cases/runc_exec.sh
index aa7020ee..32553694 100755
--- a/CI/test_cases/container_cases/runc_exec.sh
+++ b/CI/test_cases/container_cases/runc_exec.sh
@@ -26,7 +26,7 @@ test="exec_runc_test => (${FUNCNAME[@]})"
function exec_runc_test()
{
local ret=0
- local image="ubuntu"
+ local image="isulad/ubuntu"
local container_name="test_busybox"
isula pull ${image}
diff --git a/CI/test_cases/image_cases/image_digest.sh b/CI/test_cases/image_cases/image_digest.sh
index ec1cbaa5..5036239a 100755
--- a/CI/test_cases/image_cases/image_digest.sh
+++ b/CI/test_cases/image_cases/image_digest.sh
@@ -26,7 +26,7 @@ function test_image_with_digest()
{
local ret=0
local image="hub.oepkgs.net/library/busybox"
- local image2="ubuntu"
+ local image2="isulad/ubuntu"
local image_digest="hub.oepkgs.net/library/busybox@sha256:6066ca124f8c2686b7ae71aa1d6583b28c6dc3df3bdc386f2c89b92162c597d9"
local test="pull && inspect && tag image with digest test => (${FUNCNAME[@]})"
diff --git a/CI/test_cases/image_cases/image_load.sh b/CI/test_cases/image_cases/image_load.sh
index d50b3203..8a6c256a 100755
--- a/CI/test_cases/image_cases/image_load.sh
+++ b/CI/test_cases/image_cases/image_load.sh
@@ -28,6 +28,7 @@ function test_image_load()
{
local ret=0
local test="isula load image test => (${FUNCNAME[@]})"
+ local ubuntu_image="isulad/ubuntu"
msg_info "${test} starting..."
@@ -61,7 +62,7 @@ function test_image_load()
isula load -i $mult_image
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - load image failed: ${mult_image}" && ((ret++))
- ubuntu_id=`isula inspect -f '{{.image.id}}' ubuntu`
+ ubuntu_id=`isula inspect -f '{{.image.id}}' ${ubuntu_image}`
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - fail to inspect image: ubuntu" && ((ret++))
busybox_id=`isula inspect -f '{{.image.id}}' busybox`
@@ -83,11 +84,12 @@ function test_concurrent_load()
{
local ret=0
local test="isula load image test => (${FUNCNAME[@]})"
+ local ubuntu_image="isulad/ubuntu"
msg_info "${test} starting..."
# clean exist image
- ubuntu_id=`isula inspect -f '{{.image.id}}' ubuntu`
+ ubuntu_id=`isula inspect -f '{{.image.id}}' ${ubuntu_image}`
busybox_id=`isula inspect -f '{{.image.id}}' busybox`
isula rmi $ubuntu_id $busybox_id
@@ -105,7 +107,7 @@ function test_concurrent_load()
tail -n 50 /var/lib/isulad/isulad.log
- ubuntu_id=`isula inspect -f '{{.image.id}}' ubuntu`
+ ubuntu_id=`isula inspect -f '{{.image.id}}' ${ubuntu_image}`
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - fail to inspect image: ubuntu" && ((ret++))
top_layer_id=$(isula inspect -f '{{.image.top_layer}}' ${ubuntu_id})
diff --git a/CI/test_cases/image_cases/image_tag.sh b/CI/test_cases/image_cases/image_tag.sh
index 551d8249..0b8dd3e8 100755
--- a/CI/test_cases/image_cases/image_tag.sh
+++ b/CI/test_cases/image_cases/image_tag.sh
@@ -23,7 +23,7 @@ declare -r curr_path=$(dirname $(readlink -f "$0"))
source ../helpers.sh
image_busybox="busybox"
-image_hello="hello-world"
+image_hello="isulad/hello-world"
function test_tag_image()
{
diff --git a/CI/test_cases/image_cases/images_list.sh b/CI/test_cases/image_cases/images_list.sh
index 56cde5b6..a192a75c 100755
--- a/CI/test_cases/image_cases/images_list.sh
+++ b/CI/test_cases/image_cases/images_list.sh
@@ -25,7 +25,7 @@ source ../helpers.sh
function test_image_list()
{
local ret=0
- local image="hello-world"
+ local image="isulad/hello-world"
local image_busybox="busybox"
local INVALID_IMAGE="k~k"
local test="list images info test => (${FUNCNAME[@]})"
diff --git a/CI/test_cases/image_cases/integration_check.sh b/CI/test_cases/image_cases/integration_check.sh
index f340348d..6a55706c 100755
--- a/CI/test_cases/image_cases/integration_check.sh
+++ b/CI/test_cases/image_cases/integration_check.sh
@@ -27,7 +27,7 @@ image="busybox"
function test_image_info()
{
local ret=0
- local uimage="nats"
+ local uimage="isulad/nats"
local test="list && inspect image info test => (${FUNCNAME[@]})"
local lid
local cid
diff --git a/CI/test_cases/manual_cases/oom_monitor.sh b/CI/test_cases/manual_cases/oom_monitor.sh
index a1c2503d..8e991cc8 100755
--- a/CI/test_cases/manual_cases/oom_monitor.sh
+++ b/CI/test_cases/manual_cases/oom_monitor.sh
@@ -26,7 +26,7 @@ test_data_path=$(realpath $curr_path/test_data)
function test_oom_monitor()
{
local ret=0
- local ubuntu_image="ubuntu"
+ local ubuntu_image="isulad/ubuntu"
local test="container oom monitor test => (${FUNCNAME[@]})"
containername="oommonitor"
@@ -35,7 +35,7 @@ function test_oom_monitor()
isula pull ${ubuntu_image}
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to pull image: ${ubuntu_image}" && return ${FAILURE}
- isula images | grep ubuntu
+ isula images | grep ${ubuntu_image}
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - missing list image: ${ubuntu_image}" && ((ret++))
# use more than 10m memory limit, otherwise it might fail to run
diff --git a/CI/test_cases/manual_cases/security_selinux.sh b/CI/test_cases/manual_cases/security_selinux.sh
index c558befe..cf94c809 100755
--- a/CI/test_cases/manual_cases/security_selinux.sh
+++ b/CI/test_cases/manual_cases/security_selinux.sh
@@ -87,7 +87,7 @@ function daemon_disable_selinux()
function test_isulad_selinux_file_label()
{
local ret=0
- local image="centos"
+ local image="isulad/centos"
local test="isulad selinux file label test => (${FUNCNAME[@]})"
msg_info "${test} starting..."
@@ -144,7 +144,7 @@ function test_isulad_selinux_file_label()
function test_isulad_selinux_process_label()
{
local ret=0
- local image="centos"
+ local image="isulad/centos"
local test="isulad selinux process label test => (${FUNCNAME[@]})"
msg_info "${test} starting..."
@@ -172,7 +172,7 @@ function test_isulad_selinux_process_label()
function test_isulad_selinux_mount_mode()
{
local ret=0
- local image="centos"
+ local image="isulad/centos"
local test="isulad selinux mount mode test => (${FUNCNAME[@]})"
msg_info "${test} starting..."
--
2.25.1

View File

@ -0,0 +1,25 @@
From c90dab4057f73614537b3765ee06173c55d4d39c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AD=A6=E7=A7=AF=E8=B6=85?= <wujichao1@huawei.com>
Date: Wed, 11 Sep 2024 10:34:48 +0800
Subject: [PATCH 140/149] modify alpine image source to isulad/alpine
---
CI/test_cases/image_cases/integration_check.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CI/test_cases/image_cases/integration_check.sh b/CI/test_cases/image_cases/integration_check.sh
index 6a55706c..f5ae94e9 100755
--- a/CI/test_cases/image_cases/integration_check.sh
+++ b/CI/test_cases/image_cases/integration_check.sh
@@ -55,7 +55,7 @@ function test_image_info()
ucid=$(isula create ${uimage})
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - create container failed" && ((ret++))
- isula run -tid --name checker alpine
+ isula run -tid --name checker isulad/alpine
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - run container failed" && ((ret++))
tmp_fname=$(echo -n "/var/run/isulad/storage" | sha256sum | awk '{print $1}')
--
2.25.1

View File

@ -0,0 +1,26 @@
From a38db853128d0fe1c521829a4f2b17dc08f31aed Mon Sep 17 00:00:00 2001
From: chen524 <chenkui_yewu@cmss.chinamobile.com>
Date: Wed, 11 Sep 2024 04:18:46 +0000
Subject: [PATCH 141/149] update docs/design/README_zh.md.
Signed-off-by: chen524 <chenkui_yewu@cmss.chinamobile.com>
---
docs/design/README_zh.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/design/README_zh.md b/docs/design/README_zh.md
index 0f4cf13e..1a23207d 100644
--- a/docs/design/README_zh.md
+++ b/docs/design/README_zh.md
@@ -37,7 +37,7 @@
- 查看 image store 模块的设计文档: [image_store_design](./detailed/Image/image_store_design_zh.md) 。
-- 查看 layer store 模块的设计文档 [layer_store_degisn](./detailed/Image/layer_store_degisn_zh.md) 。
+- 查看 layer store 模块的设计文档: [layer_store_degisn](./detailed/Image/layer_store_degisn_zh.md) 。
- 查看 registry 模块的设计文档: [registry_degisn](./detailed/Image/registry_degisn_zh.md) 。
--
2.25.1

View File

@ -0,0 +1,34 @@
From 18a8120dfa71b50879b562692013a308b9508224 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AD=A6=E7=A7=AF=E8=B6=85?= <wujichao1@huawei.com>
Date: Wed, 11 Sep 2024 17:03:08 +0800
Subject: [PATCH 142/149] modify the image name: isulad/ubuntu to ubuntu
---
CI/test_cases/image_cases/image_load.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CI/test_cases/image_cases/image_load.sh b/CI/test_cases/image_cases/image_load.sh
index 8a6c256a..8a3fd7b3 100755
--- a/CI/test_cases/image_cases/image_load.sh
+++ b/CI/test_cases/image_cases/image_load.sh
@@ -28,7 +28,7 @@ function test_image_load()
{
local ret=0
local test="isula load image test => (${FUNCNAME[@]})"
- local ubuntu_image="isulad/ubuntu"
+ local ubuntu_image="ubuntu"
msg_info "${test} starting..."
@@ -84,7 +84,7 @@ function test_concurrent_load()
{
local ret=0
local test="isula load image test => (${FUNCNAME[@]})"
- local ubuntu_image="isulad/ubuntu"
+ local ubuntu_image="ubuntu"
msg_info "${test} starting..."
--
2.25.1

View File

@ -0,0 +1,116 @@
From f3a8da522798e68a6ba5e8f00163c4a6d05a30d0 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Wed, 7 Aug 2024 23:44:12 +1400
Subject: [PATCH 143/149] ignore chdir failed errmsg when kill and delete
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
.../modules/runtime/isula/isula_rt_ops.c | 44 ++++++++++++++-----
1 file changed, 32 insertions(+), 12 deletions(-)
diff --git a/src/daemon/modules/runtime/isula/isula_rt_ops.c b/src/daemon/modules/runtime/isula/isula_rt_ops.c
index 62cff3cf..dc156154 100644
--- a/src/daemon/modules/runtime/isula/isula_rt_ops.c
+++ b/src/daemon/modules/runtime/isula/isula_rt_ops.c
@@ -69,7 +69,7 @@
#define RESOURCE_FNAME_FORMATS "%s/resources.json"
// handle string from stderr output.
-typedef int(*handle_output_callback_t)(const char *output);
+typedef int(*handle_output_callback_t)(const char *output, const char *workdir);
typedef struct {
bool fg;
const char *id;
@@ -757,7 +757,7 @@ static int runtime_call_simple(const char *workdir, const char *runtime, const c
// we consider the runtime call simple succeeded,
// even if the process exit with failure.
if (stderr_msg != NULL && cb != NULL) {
- ret = cb(stderr_msg);
+ ret = cb(stderr_msg, workdir);
}
}
@@ -768,17 +768,37 @@ static int runtime_call_simple(const char *workdir, const char *runtime, const c
// oci runtime return -1 if the container 'does not exist'
// if output contains 'does not exist', means nothing to kill or delete, return 0
+// util_exec_cmd return -1 if chdir failed
+// if output contains 'chdir %s failed', means state dir damaged, return 0
// this will change the exit status of kill or delete command
-static int non_existent_output_check(const char *output)
+static int shielded_output_check(const char *output, const char *workdir)
{
- char *pattern = "does not exist";
+ int nret = 0;
+ const char *nonexist_pattern = "does not exist";
+ char chdir_pattern[PATH_MAX] = { 0 };
- if (output == NULL) {
+ if (output == NULL || workdir == NULL) {
return -1;
}
// container not exist, kill or delete success, return 0
- if (util_strings_contains_word(output, pattern)) {
+ if (util_strings_contains_word(output, nonexist_pattern)) {
+ return 0;
+ }
+
+ if (sizeof(chdir_pattern) > PATH_MAX - strlen("chdir ") - strlen(" failed")) {
+ INFO("chdir_pattern is too long");
+ return -1;
+ }
+
+ nret = snprintf(chdir_pattern, sizeof(chdir_pattern), "chdir %s failed", workdir);
+ if (nret < 0 || (size_t)nret >= sizeof(chdir_pattern)) {
+ INFO("Failed to make full chdir_pattern");
+ return -1;
+ }
+
+ // if output contains 'chdir ${workdir} failed', means state dir damaged, return 0
+ if (util_strings_contains_word(output, chdir_pattern)) {
return 0;
}
@@ -786,15 +806,15 @@ static int non_existent_output_check(const char *output)
return -1;
}
-// kill success or non_existent_output_check succeed return 0, DO_RETRY_CALL will break;
+// kill success or shielded_output_check succeed return 0, DO_RETRY_CALL will break;
// if kill failed, recheck on shim alive, if not alive, kill succeed, still return 0;
// else, return -1, DO_RETRY_CALL will call this again;
static int runtime_call_kill_and_check(const char *workdir, const char *runtime, const char *id)
{
int ret = -1;
- // kill succeed, return 0; non_existent_output_check succeed, return 0;
- ret = runtime_call_simple(workdir, runtime, "kill", NULL, 0, id, non_existent_output_check);
+ // kill succeed, return 0; shielded_output_check succeed, return 0;
+ ret = runtime_call_simple(workdir, runtime, "kill", NULL, 0, id, shielded_output_check);
if (ret == 0) {
return 0;
}
@@ -814,8 +834,8 @@ static int runtime_call_delete_force(const char *workdir, const char *runtime, c
// if the container does not exist when force deleting it,
// runc will report an error and isulad does not need to retry the deletion again.
// related PR ID:d1a743674a98e23d348b29f52c43436356f56b79
- // non_existent_output_check succeed, return 0;
- return runtime_call_simple(workdir, runtime, "delete", opts, 1, id, non_existent_output_check);
+ // shielded_output_check succeed, return 0;
+ return runtime_call_simple(workdir, runtime, "delete", opts, 1, id, shielded_output_check);
}
#define ExitSignalOffset 128
@@ -1825,7 +1845,7 @@ static int create_resources_json_file(const char *workdir, const shim_client_cgr
}
// show std error msg, always return -1.
-static int show_stderr(const char *err)
+static int show_stderr(const char *err, const char *workdir)
{
isulad_set_error_message(err);
return -1;
--
2.25.1

View File

@ -0,0 +1,28 @@
From f526268e2b78330dfe6b63eb5f6ece7417f4c06e Mon Sep 17 00:00:00 2001
From: jikai <jikai11@huawei.com>
Date: Sat, 27 Apr 2024 14:38:58 +0800
Subject: [PATCH 144/149] followlocation only not with head
Signed-off-by: jikai <jikai11@huawei.com>
---
src/utils/http/http.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/utils/http/http.c b/src/utils/http/http.c
index 8b74f773..c9bb5959 100644
--- a/src/utils/http/http.c
+++ b/src/utils/http/http.c
@@ -495,7 +495,9 @@ int http_request(const char *url, struct http_get_options *options, long *respon
if (options->resume) {
curl_easy_setopt(curl_handle, CURLOPT_RESUME_FROM_LARGE, (curl_off_t)fsize);
}
- curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
+ if (options->with_head == 0) {
+ curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
+ }
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, pagefile);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, fwrite_file);
} else {
--
2.25.1

View File

@ -0,0 +1,28 @@
From 06dca49eacebb94a6d38de5042e3608bce0e366f Mon Sep 17 00:00:00 2001
From: Beans <gujiateng_yewu@cmss.chinamobile.com>
Date: Tue, 24 Sep 2024 03:15:14 +0000
Subject: [PATCH 145/149] update
docs/design/detailed/Image/image_storage_driver_design_zh.md. This place is
spelled wrong.
Signed-off-by: Beans <gujiateng_yewu@cmss.chinamobile.com>
---
docs/design/detailed/Image/image_storage_driver_design_zh.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/design/detailed/Image/image_storage_driver_design_zh.md b/docs/design/detailed/Image/image_storage_driver_design_zh.md
index ea82df14..9799fc31 100644
--- a/docs/design/detailed/Image/image_storage_driver_design_zh.md
+++ b/docs/design/detailed/Image/image_storage_driver_design_zh.md
@@ -116,7 +116,7 @@ int graphdriver_cleanup(void)
## 3.1 Driver 初始化
-Driver 初始化初始化流程:
+Driver 初始化流程:
![driver_init](https://images.gitee.com/uploads/images/2020/0327/103821_1d31a134_5226885.png)
Overlay 模块初始化流程:
--
2.25.1

View File

@ -0,0 +1,77 @@
From b9b6e5bd6984db8ab33ea1f7d8650113d8c21fd1 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Fri, 27 Sep 2024 17:26:03 +1400
Subject: [PATCH 146/149] upgrade isulad compilation script
install_iSulad_on_Ubuntu_20_04_LTS
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
CI/dockerfiles/Dockerfile-ubuntu | 2 +-
.../install_iSulad_on_Ubuntu_20_04_LTS.sh | 26 +++++++++++++++----
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/CI/dockerfiles/Dockerfile-ubuntu b/CI/dockerfiles/Dockerfile-ubuntu
index 09a20eb5..6420173a 100644
--- a/CI/dockerfiles/Dockerfile-ubuntu
+++ b/CI/dockerfiles/Dockerfile-ubuntu
@@ -83,8 +83,8 @@ RUN apt update -y && apt upgrade -y && \
patch \
tcpdump
+RUN apt install -y ninja-build meson
RUN apt install -y libncurses-dev && apt autoremove -y
-RUN pip3 install meson ninja
RUN echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> /etc/bashrc && \
echo "export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:$LD_LIBRARY_PATH" >> /etc/bashrc && \
diff --git a/docs/build_docs/guide/script/install_iSulad_on_Ubuntu_20_04_LTS.sh b/docs/build_docs/guide/script/install_iSulad_on_Ubuntu_20_04_LTS.sh
index f44bddb4..35995ff4 100755
--- a/docs/build_docs/guide/script/install_iSulad_on_Ubuntu_20_04_LTS.sh
+++ b/docs/build_docs/guide/script/install_iSulad_on_Ubuntu_20_04_LTS.sh
@@ -7,10 +7,25 @@ set -e
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH
echo "/usr/local/lib" >> /etc/ld.so.conf
-apt install -y g++ libprotobuf-dev protobuf-compiler protobuf-compiler-grpc libgrpc++-dev libgrpc-dev libtool automake autoconf cmake make pkg-config libyajl-dev zlib1g-dev libselinux1-dev libseccomp-dev libcap-dev libsystemd-dev git libarchive-dev libcurl4-gnutls-dev openssl libdevmapper-dev python3 libtar0 libtar-dev libwebsockets-dev
+
+
+if [ ! -e "/etc/timezone" ]; then
+ export TZ=Asia/Shanghai
+ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+fi
+
+apt update -y && apt upgrade -y
+apt install -y g++ systemd libprotobuf-dev protobuf-compiler protobuf-compiler-grpc libgrpc++-dev libgrpc-dev libtool automake autoconf cmake make pkg-config libyajl-dev zlib1g-dev libselinux1-dev libseccomp-dev libcap-dev libsystemd-dev git libarchive-dev libcurl4-gnutls-dev openssl libdevmapper-dev python3 libtar0 libtar-dev libwebsockets-dev
+
+apt install -y runc
+
+apt install -y docbook2x ninja-build meson
+apt install -y libncurses-dev
BUILD_DIR=/tmp/build_isulad
+git config --global http.sslverify false
+
rm -rf $BUILD_DIR
mkdir -p $BUILD_DIR
@@ -18,11 +33,12 @@ mkdir -p $BUILD_DIR
cd $BUILD_DIR
git clone https://gitee.com/src-openeuler/lxc.git
cd lxc
+git config --global --add safe.directory $BUILD_DIR/lxc/lxc-5.0.2
./apply-patches
-cd lxc-4.0.3
-./autogen.sh
-./configure
-make -j $(nproc)
+cd lxc-5.0.2
+meson setup -Disulad=true \
+ -Dprefix=/usr build
+meson compile -C build
make install
# build lcr
--
2.25.1

View File

@ -0,0 +1,26 @@
From d0bfea1f4858672345d1b885bfb9ee1f6072c396 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Sun, 29 Sep 2024 17:22:42 +1400
Subject: [PATCH 147/149] bugfix for log in make_safedir_is_noexec
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/utils/tar/util_archive.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils/tar/util_archive.c b/src/utils/tar/util_archive.c
index 985e0f16..b946dd39 100644
--- a/src/utils/tar/util_archive.c
+++ b/src/utils/tar/util_archive.c
@@ -219,7 +219,7 @@ static int make_safedir_is_noexec(const char *flock_path, const char *dstdir, ch
}
if (realpath(isulad_tmpdir_env, cleanpath) == NULL) {
- ERROR("Failed to get real path for %s", isula_tmpdir);
+ SYSERROR("Failed to get real path for %s", isulad_tmpdir_env);
return -1;
}
--
2.25.1

View File

@ -0,0 +1,29 @@
From 5721206da703bf827cd125feb8f9bf518f10f69c Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Mon, 14 Oct 2024 19:27:57 +0800
Subject: [PATCH 148/149] containers in paused state are not allowed to start
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/daemon/executor/container_cb/execution.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/daemon/executor/container_cb/execution.c b/src/daemon/executor/container_cb/execution.c
index f924a208..2e54f085 100644
--- a/src/daemon/executor/container_cb/execution.c
+++ b/src/daemon/executor/container_cb/execution.c
@@ -584,6 +584,11 @@ static int container_start_cb(const container_start_request *request, container_
if (container_is_running(cont->state)) {
INFO("Container is already running");
+ if (container_is_paused(cont->state)) {
+ cc = ISULAD_ERR_EXEC;
+ ERROR("cannot start a paused container, try unpause instead");
+ isulad_set_error_message("cannot start a paused container, try unpause instead");
+ }
goto pack_response;
}
--
2.25.1

View File

@ -0,0 +1,38 @@
From e7778ed261d2550ea6e2179b856d0ee22241b858 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Mon, 14 Oct 2024 20:42:58 +0800
Subject: [PATCH 149/149] remove meaningless code
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.cc | 1 -
src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h | 1 -
2 files changed, 2 deletions(-)
diff --git a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.cc b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.cc
index 56c89c1e..23b620c3 100644
--- a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.cc
@@ -24,7 +24,6 @@ CRIRuntimeServiceImpl::CRIRuntimeServiceImpl(const std::string &podSandboxImage,
, m_containerManager(new ContainerManagerService(cb))
, m_podSandboxManager(new PodSandboxManagerService(podSandboxImage, cb, pluginManager, enablePodEvents))
, m_runtimeManager(new RuntimeManagerService(cb, pluginManager))
- , m_enablePodEvents(enablePodEvents)
{
}
diff --git a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
index 33539a32..1d399a85 100644
--- a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
+++ b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
@@ -104,7 +104,6 @@ protected:
private:
std::string m_podSandboxImage;
std::shared_ptr<Network::PluginManager> m_pluginManager { nullptr };
- [[maybe_unused]] bool m_enablePodEvents;
};
} // namespace CRIV1
#endif // DAEMON_ENTRY_CRI_V1_CRI_RUNTIME_SERVICE_IMPL_H
--
2.25.1

View File

@ -0,0 +1,25 @@
From f7e8abb13d1f1fd4b3c322853c91ef490da7141b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AD=A6=E7=A7=AF=E8=B6=85?= <wujichao1@huawei.com>
Date: Tue, 22 Oct 2024 15:57:55 +0800
Subject: [PATCH] fix unqualified call to "std::move"
---
src/daemon/entry/cri/v1alpha/cri_image_manager_service_impl.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/daemon/entry/cri/v1alpha/cri_image_manager_service_impl.cc b/src/daemon/entry/cri/v1alpha/cri_image_manager_service_impl.cc
index cf636428..a14dc626 100644
--- a/src/daemon/entry/cri/v1alpha/cri_image_manager_service_impl.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_image_manager_service_impl.cc
@@ -149,7 +149,7 @@ void ImageManagerServiceImpl::list_images_to_grpc(im_list_response *response,
imagetool_image_summary *element = list_images->images[i];
conv_image_to_grpc(element, image);
- images.push_back(move(image));
+ images.push_back(std::move(image));
}
}
--
2.25.1

View File

@ -1,5 +1,5 @@
%global _version 2.1.5
%global _release 11
%global _release 12
%global is_systemd 1
%global enable_criv1 1
%global enable_cdi 1
@ -124,7 +124,39 @@ Patch0105: 0105-start-sandbox-before-setup-network-by-default.patch
Patch0106: 0106-Revert-use-isula_clean_path-rather-than-realpath.patch
Patch0107: 0107-bugfix-for-start-sandbox-before-setup-network-by-def.patch
Patch0108: 0108-skip-test-rely-on-docker.io.patch
Patch0109: 0109-fix-clang-build-error.patch
Patch0109: 0109-modify-default-registry-mirrors-in-ci-test.patch
Patch0110: 0110-add-timestamp-in-PodSandboxStatu-response.patch
Patch0111: 0111-bugfix-for-file-param-verify.patch
Patch0112: 0112-bugfix-change-cni-log-info.patch
Patch0113: 0113-move-shutdown-handle-after-init-module.patch
Patch0114: 0114-bugfix-for-null-pointer-reference.patch
Patch0115: 0115-bugfix-for-m_criService-shutdown.patch
Patch0116: 0116-fix-bug-in-ci-test.patch
Patch0117: 0117-add-nri-design-doc.patch
Patch0118: 0118-NRI-add-nri-head-file-and-common-func.patch
Patch0119: 0119-skip-calling-cni-plugin-cleanup-when-network-namespa.patch
Patch0120: 0120-nri-add-convert-and-utils-impl-for-nri.patch
Patch0121: 0121-get-realpath-before-ns-mountpoint-verification.patch
Patch0122: 0122-nri-impl-for-nri-plugin-and-adaption.patch
Patch0123: 0123-code-improve-for-codecheck.patch
Patch0124: 0124-change-pull-registry-to-hub.oepkgs.net.patch
Patch0125: 0125-fix-clang-build-error.patch
Patch0126: 0126-add-a-new-registry-to-prevent-missing-mirrors.patch
Patch0127: 0127-change-image-digest-ci-test-for-registry-change.patch
Patch0128: 0128-bugfix-for-ci-make-and-install-shell.patch
Patch0129: 0129-do-not-use-1000-as-the-test-gid-to-prevent-conflicts.patch
Patch0130: 0130-only-use-the-openeuler-mirror-registry-in-ci.patch
Patch0131: 0131-modify-alpine-image-source-to-isulad-alpine.patch
Patch0132: 0132-update-docs-design-README_zh.md.patch
Patch0133: 0133-modify-the-image-name-isulad-ubuntu-to-ubuntu.patch
Patch0134: 0134-ignore-chdir-failed-errmsg-when-kill-and-delete.patch
Patch0135: 0135-followlocation-only-not-with-head.patch
Patch0136: 0136-update-docs-design-detailed-Image-image_storage_driv.patch
Patch0137: 0137-upgrade-isulad-compilation-script-install_iSulad_on_.patch
Patch0138: 0138-bugfix-for-log-in-make_safedir_is_noexec.patch
Patch0139: 0139-containers-in-paused-state-are-not-allowed-to-start.patch
Patch0140: 0140-remove-meaningless-code.patch
Patch0141: 0141-fix-unqualified-call-to-std-move.patch
%ifarch x86_64 aarch64
Provides: libhttpclient.so()(64bit)
@ -381,11 +413,17 @@ fi
%endif
%changelog
* Fri Aug 30 2024 yanying <201250106@smail.nju.edu.cn> - 2.1.5-11
* Mon Oct 21 2024 wujichao <wujichao1@huawei.com> - 2.1.5-12
- Type: update
- ID: NA
- SUG: NA
- DESC: fix clang build error
- DESC: combine ten similar submissions into one(0125-fix-clang-build-error.patch) and Upgrade from upstream
* Mon Aug 19 2024 zhongtao <zhongtao17@huawei.com> - 2.1.5-11
- Type: update
- ID: NA
- SUG: NA
- DESC: add impl for nri and bugfix
* Tue Jun 11 2024 zhongtao <zhongtao17@huawei.com> - 2.1.5-10
- Type: update