From 291d95e65a0cbb1a50c3de7f5f514d5bd9c8bf5d Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Mon, 6 Jan 2025 11:21:10 +0000 Subject: [PATCH] refactor(libsinsp/container_engine): drop request_rw_size Signed-off-by: Roberto Scolaro --- .../libsinsp/container_engine/containerd.cpp | 2 +- .../libsinsp/container_engine/containerd.h | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/userspace/libsinsp/container_engine/containerd.cpp b/userspace/libsinsp/container_engine/containerd.cpp index 8659b00250..c6f6b9f2bc 100644 --- a/userspace/libsinsp/container_engine/containerd.cpp +++ b/userspace/libsinsp/container_engine/containerd.cpp @@ -324,7 +324,7 @@ bool libsinsp::container_engine::containerd::resolve(sinsp_threadinfo *tinfo, return false; } - containerd_lookup_request request(container_id, CT_CONTAINERD, 0, false); + containerd_lookup_request request(container_id, CT_CONTAINERD, 0); container_cache_interface *cache = &container_cache(); sinsp_container_info::ptr_t container_info = cache->get_container(request.container_id); diff --git a/userspace/libsinsp/container_engine/containerd.h b/userspace/libsinsp/container_engine/containerd.h index 2181884059..30bcaeccd5 100644 --- a/userspace/libsinsp/container_engine/containerd.h +++ b/userspace/libsinsp/container_engine/containerd.h @@ -34,16 +34,14 @@ namespace libsinsp { namespace container_engine { struct containerd_lookup_request { - containerd_lookup_request(): container_type(CT_CONTAINERD), uid(0), request_rw_size(false) {} + containerd_lookup_request(): container_type(CT_CONTAINERD), uid(0) {} containerd_lookup_request(const std::string& container_id_value, sinsp_container_type container_type_value, - unsigned long uid_value, - bool rw_size_value): + unsigned long uid_value): container_id(container_id_value), container_type(container_type_value), - uid(uid_value), - request_rw_size(rw_size_value) {} + uid(uid_value) {} bool operator<(const containerd_lookup_request& rhs) const { if(container_id != rhs.container_id) { @@ -54,22 +52,17 @@ struct containerd_lookup_request { return container_type < rhs.container_type; } - if(uid != rhs.uid) { - return uid < rhs.uid; - } - - return request_rw_size < rhs.request_rw_size; + return uid < rhs.uid; } bool operator==(const containerd_lookup_request& rhs) const { return container_id == rhs.container_id && container_type == rhs.container_type && - uid == rhs.uid && request_rw_size == rhs.request_rw_size; + uid == rhs.uid; } std::string container_id; sinsp_container_type container_type; unsigned long uid; - bool request_rw_size; }; class containerd_async_source : public container_async_source {