From 6b1d8d6d6f7e8c1d3f3b455c59629d4804eb4ed2 Mon Sep 17 00:00:00 2001 From: Melissa Kilby Date: Tue, 12 Mar 2024 18:25:55 +0000 Subject: [PATCH] fix(container_engine): explicitely set lookup state for all engines Signed-off-by: Melissa Kilby --- userspace/libsinsp/container_engine/bpm.cpp | 1 + userspace/libsinsp/container_engine/docker/base.cpp | 1 + userspace/libsinsp/container_engine/libvirt_lxc.cpp | 1 + userspace/libsinsp/container_engine/lxc.cpp | 1 + userspace/libsinsp/container_engine/mesos.cpp | 1 + userspace/libsinsp/container_engine/rkt.cpp | 1 + 6 files changed, 6 insertions(+) diff --git a/userspace/libsinsp/container_engine/bpm.cpp b/userspace/libsinsp/container_engine/bpm.cpp index 298954f75d..9e482d1cb7 100644 --- a/userspace/libsinsp/container_engine/bpm.cpp +++ b/userspace/libsinsp/container_engine/bpm.cpp @@ -61,6 +61,7 @@ bool bpm::resolve(sinsp_threadinfo *tinfo, bool query_os_for_missing_info) if(container_cache().should_lookup(container_info.m_id, CT_BPM)) { container_info.m_name = container_info.m_id; + container_info.set_lookup_status(sinsp_container_lookup::state::SUCCESSFUL); container_cache().add_container(std::make_shared(container_info), tinfo); container_cache().notify_new_container(container_info, tinfo); } diff --git a/userspace/libsinsp/container_engine/docker/base.cpp b/userspace/libsinsp/container_engine/docker/base.cpp index 287e91064a..b5b29a2da7 100644 --- a/userspace/libsinsp/container_engine/docker/base.cpp +++ b/userspace/libsinsp/container_engine/docker/base.cpp @@ -33,6 +33,7 @@ docker_base::resolve_impl(sinsp_threadinfo *tinfo, const docker_lookup_request& auto container = sinsp_container_info(); container.m_type = request.container_type; container.m_id = request.container_id; + container.set_lookup_status(sinsp_container_lookup::state::SUCCESSFUL); cache->notify_new_container(container, tinfo); return true; } diff --git a/userspace/libsinsp/container_engine/libvirt_lxc.cpp b/userspace/libsinsp/container_engine/libvirt_lxc.cpp index c92bbfb59e..c62db286a7 100644 --- a/userspace/libsinsp/container_engine/libvirt_lxc.cpp +++ b/userspace/libsinsp/container_engine/libvirt_lxc.cpp @@ -85,6 +85,7 @@ bool libvirt_lxc::resolve(sinsp_threadinfo *tinfo, bool query_os_for_missing_inf if(container_cache().should_lookup(container.m_id, CT_LIBVIRT_LXC)) { container.m_name = container.m_id; + container.set_lookup_status(sinsp_container_lookup::state::SUCCESSFUL); container_cache().add_container(std::make_shared(container), tinfo); container_cache().notify_new_container(container, tinfo); } diff --git a/userspace/libsinsp/container_engine/lxc.cpp b/userspace/libsinsp/container_engine/lxc.cpp index 1e1a5de461..f217b7749d 100644 --- a/userspace/libsinsp/container_engine/lxc.cpp +++ b/userspace/libsinsp/container_engine/lxc.cpp @@ -64,6 +64,7 @@ bool lxc::resolve(sinsp_threadinfo *tinfo, bool query_os_for_missing_info) if (container_cache().should_lookup(container.m_id, CT_LXC)) { container.m_name = container.m_id; + container.set_lookup_status(sinsp_container_lookup::state::SUCCESSFUL); container_cache().add_container(std::make_shared(container), tinfo); container_cache().notify_new_container(container, tinfo); } diff --git a/userspace/libsinsp/container_engine/mesos.cpp b/userspace/libsinsp/container_engine/mesos.cpp index 9154aad969..22d123fcee 100644 --- a/userspace/libsinsp/container_engine/mesos.cpp +++ b/userspace/libsinsp/container_engine/mesos.cpp @@ -62,6 +62,7 @@ bool libsinsp::container_engine::mesos::resolve(sinsp_threadinfo* tinfo, bool qu if(container_cache().should_lookup(container.m_id, CT_MESOS)) { container.m_name = container.m_id; + container.set_lookup_status(sinsp_container_lookup::state::SUCCESSFUL); container_cache().add_container(std::make_shared(container), tinfo); container_cache().notify_new_container(container, tinfo); } diff --git a/userspace/libsinsp/container_engine/rkt.cpp b/userspace/libsinsp/container_engine/rkt.cpp index a365c5f367..29556020fa 100644 --- a/userspace/libsinsp/container_engine/rkt.cpp +++ b/userspace/libsinsp/container_engine/rkt.cpp @@ -188,6 +188,7 @@ bool rkt::rkt::resolve(sinsp_threadinfo* tinfo, bool query_os_for_missing_info) if (have_rkt) { + container.set_lookup_status(sinsp_container_lookup::state::SUCCESSFUL); cache->add_container(std::make_shared(container), tinfo); cache->notify_new_container(container, tinfo); return true;