1 Star 0 Fork 46

wangfengtu/src-iSulad

forked from src-openEuler/iSulad 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0028-add-filter-to-get-only-non-sandbox-containers.patch 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
gaohuatao 提交于 2020-11-12 19:32 . update from openeuler
From 1a01070d00c9bf9ff65308522486edcfe16ed46c Mon Sep 17 00:00:00 2001
From: gaohuatao <[email protected]>
Date: Wed, 11 Nov 2020 11:10:36 +0800
Subject: [PATCH 28/28] add filter to get only non-sandbox containers
Signed-off-by: gaohuatao <[email protected]>
---
src/daemon/entry/cri/cri_container.cc | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/daemon/entry/cri/cri_container.cc b/src/daemon/entry/cri/cri_container.cc
index c6d9599..e23e59e 100644
--- a/src/daemon/entry/cri/cri_container.cc
+++ b/src/daemon/entry/cri/cri_container.cc
@@ -788,6 +788,12 @@ void CRIRuntimeServiceImpl::ListContainersFromGRPC(const runtime::v1alpha2::Cont
error.SetError("Out of memory");
return;
}
+ // Add filter to get only non-sandbox containers
+ if (CRIHelpers::FiltersAddLabel((*request)->filters, CRIHelpers::Constants::CONTAINER_TYPE_LABEL_KEY,
+ CRIHelpers::Constants::CONTAINER_TYPE_LABEL_CONTAINER) != 0) {
+ error.SetError("Failed to add filter");
+ return;
+ }
if (filter != nullptr) {
if (!filter->id().empty()) {
@@ -811,12 +817,6 @@ void CRIRuntimeServiceImpl::ListContainersFromGRPC(const runtime::v1alpha2::Cont
}
}
- // Add some label
- if (CRIHelpers::FiltersAddLabel((*request)->filters, CRIHelpers::Constants::CONTAINER_TYPE_LABEL_KEY,
- CRIHelpers::Constants::CONTAINER_TYPE_LABEL_CONTAINER) != 0) {
- error.SetError("Failed to add filter");
- return;
- }
for (auto &iter : filter->label_selector()) {
if (CRIHelpers::FiltersAddLabel((*request)->filters, iter.first, iter.second) != 0) {
error.SetError("Failed to add filter");
--
2.20.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangfengtu/src-iSulad.git
[email protected]:wangfengtu/src-iSulad.git
wangfengtu
src-iSulad
src-iSulad
master

搜索帮助