From 92393e4ea891127e6741433b392d7180dedbf414 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Fri, 18 Oct 2024 22:37:36 +0100 Subject: [PATCH] [containerd] Collect image and container list Resolves: SET-680 Signed-off-by: Arif Ali --- sos/report/plugins/containerd.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sos/report/plugins/containerd.py b/sos/report/plugins/containerd.py index a8122ed683..4b1eaee72f 100644 --- a/sos/report/plugins/containerd.py +++ b/sos/report/plugins/containerd.py @@ -6,10 +6,10 @@ # # See the LICENSE file in the source distribution for further information. -from sos.report.plugins import (Plugin, RedHatPlugin, UbuntuPlugin, CosPlugin) +from sos.report.plugins import Plugin, IndependentPlugin -class Containerd(Plugin, RedHatPlugin, UbuntuPlugin, CosPlugin): +class Containerd(Plugin, IndependentPlugin): short_desc = 'Containerd containers' plugin_name = 'containerd' @@ -25,6 +25,13 @@ def setup(self): self.add_cmd_output('containerd config dump') self.add_cmd_output('ctr deprecations list') + pre_cmd = 'ctr -n k8s.io' + + self.add_cmd_output([ + f'{pre_cmd} image ls', + f'{pre_cmd} container ls', + ]) + # collect the containerd logs. self.add_journal(units='containerd')