77 lines
3.3 KiB
Diff
77 lines
3.3 KiB
Diff
From 3d8c6127161acbe35bf03fe495ac43e2b9242cbf Mon Sep 17 00:00:00 2001
|
|
From: jikai <jikai11@huawei.com>
|
|
Date: Tue, 19 Dec 2023 18:31:30 +0800
|
|
Subject: [PATCH 65/71] fix stopp removes cont error & remove inspect error log
|
|
|
|
Signed-off-by: jikai <jikai11@huawei.com>
|
|
---
|
|
.../cri_pod_sandbox_manager_service.cc | 36 ++++++++-----------
|
|
.../container_cb/execution_information.c | 2 +-
|
|
2 files changed, 15 insertions(+), 23 deletions(-)
|
|
|
|
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 bc40cb06..4d1d19eb 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
|
|
@@ -703,30 +703,22 @@ auto PodSandboxManagerService::GetRealSandboxIDToStop(const std::string &podSand
|
|
std::map<std::string, std::string> &stdAnnos, Errors &error)
|
|
-> int
|
|
{
|
|
- Errors statusErr;
|
|
+ auto status = PodSandboxStatus(podSandboxID, error);
|
|
+ if (error.NotEmpty()) {
|
|
+ return -1;
|
|
+ }
|
|
|
|
- auto status = PodSandboxStatus(podSandboxID, statusErr);
|
|
- if (statusErr.Empty()) {
|
|
- if (status->linux().namespaces().has_options()) {
|
|
- hostNetwork = (status->linux().namespaces().options().network() == runtime::v1alpha2::NamespaceMode::NODE);
|
|
- }
|
|
- // if metadata is invalid, don't return -1 and continue stopping pod
|
|
- if (status->has_metadata()) {
|
|
- name = status->metadata().name();
|
|
- ns = status->metadata().namespace_();
|
|
- }
|
|
- realSandboxID = status->id();
|
|
- CRIHelpers::ProtobufAnnoMapToStd(status->annotations(), stdAnnos);
|
|
- } else {
|
|
- if (CRIHelpers::IsContainerNotFoundError(statusErr.GetMessage())) {
|
|
- WARN("Both sandbox container and checkpoint for id %s could not be found. "
|
|
- "Proceed without further sandbox information.",
|
|
- podSandboxID.c_str());
|
|
- } else {
|
|
- error.Errorf("failed to get sandbox status: %s", statusErr.GetCMessage());
|
|
- return -1;
|
|
- }
|
|
+ if (status->linux().namespaces().has_options()) {
|
|
+ hostNetwork = (status->linux().namespaces().options().network() == runtime::v1alpha2::NamespaceMode::NODE);
|
|
}
|
|
+ // if metadata is invalid, don't return -1 and continue stopping pod
|
|
+ if (status->has_metadata()) {
|
|
+ name = status->metadata().name();
|
|
+ ns = status->metadata().namespace_();
|
|
+ }
|
|
+ realSandboxID = status->id();
|
|
+ CRIHelpers::ProtobufAnnoMapToStd(status->annotations(), stdAnnos);
|
|
+
|
|
if (realSandboxID.empty()) {
|
|
realSandboxID = podSandboxID;
|
|
}
|
|
diff --git a/src/daemon/executor/container_cb/execution_information.c b/src/daemon/executor/container_cb/execution_information.c
|
|
index 420f08df..03fce848 100644
|
|
--- a/src/daemon/executor/container_cb/execution_information.c
|
|
+++ b/src/daemon/executor/container_cb/execution_information.c
|
|
@@ -914,7 +914,7 @@ static int inspect_container_helper(const char *id, int timeout, char **containe
|
|
|
|
inspect = inspect_container(id, timeout, true);
|
|
if (inspect == NULL) {
|
|
- ERROR("Failed to inspect container:%s", id);
|
|
+ DEBUG("Failed to inspect container:%s", id);
|
|
ret = -1;
|
|
goto out;
|
|
}
|
|
--
|
|
2.25.1
|
|
|