diff options
author | CoprDistGit <infra@openeuler.org> | 2025-03-04 12:23:00 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2025-03-04 12:23:00 +0000 |
commit | 434d8166bff360cdb7039326bb617ebaca98face (patch) | |
tree | 1b0333fc674186afc80e2193efebadf8d521d51f /0158-Revert-move-nri-call-in-stop-and-remove-con.patch | |
parent | 2ccdcb50a81459161cf6b42f0b45c2b86e1bbf76 (diff) |
automatic import of iSuladopeneuler22.03_LTS
Diffstat (limited to '0158-Revert-move-nri-call-in-stop-and-remove-con.patch')
-rw-r--r-- | 0158-Revert-move-nri-call-in-stop-and-remove-con.patch | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/0158-Revert-move-nri-call-in-stop-and-remove-con.patch b/0158-Revert-move-nri-call-in-stop-and-remove-con.patch new file mode 100644 index 0000000..e2a0d61 --- /dev/null +++ b/0158-Revert-move-nri-call-in-stop-and-remove-con.patch @@ -0,0 +1,87 @@ +From e160e82c1a7eff3c9cca9794a4db04508e9ffb05 Mon Sep 17 00:00:00 2001 +From: zhongtao <zhongtao17@huawei.com> +Date: Wed, 18 Dec 2024 22:54:32 +1400 +Subject: [PATCH 158/158] Revert "move nri call in stop and remove con" + +This reverts commit db60c64138b45539fe70282c853ac2dae5954924. +--- + src/daemon/common/cri/cri_helpers.cc | 18 ------------------ + .../cri/v1/v1_cri_container_manager_service.cc | 14 ++++++++++++++ + 2 files changed, 14 insertions(+), 18 deletions(-) + +diff --git a/src/daemon/common/cri/cri_helpers.cc b/src/daemon/common/cri/cri_helpers.cc +index aa8e3c19..a8cbd996 100644 +--- a/src/daemon/common/cri/cri_helpers.cc ++++ b/src/daemon/common/cri/cri_helpers.cc +@@ -32,10 +32,6 @@ + #include "isulad_config.h" + #include "sha256.h" + +-#ifdef ENABLE_NRI +-#include "nri_adaption.h" +-#endif +- + namespace CRIHelpers { + const std::string Constants::POD_NETWORK_ANNOTATION_KEY { "network.alpha.kubernetes.io/network" }; + const std::string Constants::CONTAINER_TYPE_LABEL_KEY { "cri.isulad.type" }; +@@ -664,13 +660,6 @@ void RemoveContainerHelper(service_executor_t *cb, const std::string &containerI + goto cleanup; + } + +-#ifdef ENABLE_NRI +- if (!NRIAdaptation::GetInstance()->RemoveContainer(containerID, error)) { +- ERROR("NRI RemoveContainer notification failed: %s", error.GetCMessage()); +- } +- error.Clear(); +-#endif +- + if (cb->container.remove(request, &response) != 0) { + if (response != nullptr && response->errmsg != nullptr) { + error.SetError(response->errmsg); +@@ -730,13 +719,6 @@ void StopContainerHelper(service_executor_t *cb, const std::string &containerID, + error.SetError(msg); + } + +-#ifdef ENABLE_NRI +- if (!NRIAdaptation::GetInstance()->StopContainer(containerID, error)) { +- ERROR("NRI StopContainer notification failed: %s", error.GetCMessage()); +- } +- error.Clear(); +-#endif +- + free_container_stop_request(request); + free_container_stop_response(response); + } +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 b585b49c..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 +@@ -618,11 +618,25 @@ cleanup: + + void ContainerManagerService::StopContainer(const std::string &containerID, int64_t timeout, Errors &error) + { ++#ifdef ENABLE_NRI ++ Errors nriErr; ++#endif + CRIHelpers::StopContainer(m_cb, containerID, timeout, error); ++#ifdef ENABLE_NRI ++ if (!NRIAdaptation::GetInstance()->StopContainer(containerID, nriErr)) { ++ ERROR("NRI StopContainer notification failed: %s", nriErr.GetCMessage()); ++ } ++#endif + } + + void ContainerManagerService::RemoveContainer(const std::string &containerID, Errors &error) + { ++#ifdef ENABLE_NRI ++ Errors nriErr; ++ if (!NRIAdaptation::GetInstance()->RemoveContainer(containerID, nriErr)) { ++ ERROR("NRI RemoveContainer notification failed: %s", nriErr.GetCMessage()); ++ } ++#endif + CRIHelpers::RemoveContainer(m_cb, containerID, error); + if (error.NotEmpty()) { + WARN("Failed to remove container %s", containerID.c_str()); +-- +2.25.1 + |