1 Star 0 Fork 44

严莹/iSulad

forked from src-openEuler/iSulad 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0082-fix-shim-controller-set-incorrect-sandbox-status-sta.patch 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
liuxu 提交于 2024-05-11 16:29 . upgrade from upstream
From 1d51e3e9f14199854cc2d586651c5809345aee18 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Wed, 8 May 2024 14:48:47 +0800
Subject: [PATCH 82/85] fix shim controller set incorrect sandbox status state
Signed-off-by: jikai <jikai11@huawei.com>
---
src/daemon/sandbox/controller/controller.h | 3 +++
src/daemon/sandbox/controller/shim/shim_controller.cc | 6 ++++--
src/daemon/sandbox/sandbox.cc | 3 ---
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/daemon/sandbox/controller/controller.h b/src/daemon/sandbox/controller/controller.h
index f479a0ac..9ad45855 100644
--- a/src/daemon/sandbox/controller/controller.h
+++ b/src/daemon/sandbox/controller/controller.h
@@ -27,6 +27,9 @@
namespace sandbox {
+#define SANDBOX_READY_STATE_STR "SANDBOX_READY"
+#define SANDBOX_NOTREADY_STATE_STR "SANDBOX_NOTREADY"
+
struct ControllerMountInfo {
std::string source;
std::string destination;
diff --git a/src/daemon/sandbox/controller/shim/shim_controller.cc b/src/daemon/sandbox/controller/shim/shim_controller.cc
index 4da637c7..ce09c076 100644
--- a/src/daemon/sandbox/controller/shim/shim_controller.cc
+++ b/src/daemon/sandbox/controller/shim/shim_controller.cc
@@ -446,8 +446,10 @@ void ShimController::InspectResponseToSandboxStatus(container_inspect *inspect,
sandboxStatus.id = inspect->id;
if (inspect->state != nullptr) {
sandboxStatus.pid = inspect->state->pid;
- if (inspect->state->status != nullptr) {
- sandboxStatus.state = std::string(inspect->state->status);
+ if (inspect->state->running) {
+ sandboxStatus.state = std::string(SANDBOX_READY_STATE_STR);
+ } else {
+ sandboxStatus.state = std::string(SANDBOX_NOTREADY_STATE_STR);
}
}
diff --git a/src/daemon/sandbox/sandbox.cc b/src/daemon/sandbox/sandbox.cc
index 279bf628..d44abb99 100644
--- a/src/daemon/sandbox/sandbox.cc
+++ b/src/daemon/sandbox/sandbox.cc
@@ -39,9 +39,6 @@
#include "utils_timestamp.h"
#include "mailbox.h"
-#define SANDBOX_READY_STATE_STR "SANDBOX_READY"
-#define SANDBOX_NOTREADY_STATE_STR "SANDBOX_NOTREADY"
-
namespace sandbox {
const std::string SHM_MOUNT_POINT = "/dev/shm";
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yanyir/iSulad.git
git@gitee.com:yanyir/iSulad.git
yanyir
iSulad
iSulad
master

搜索帮助