Blame SOURCES/sos-bz1679238-crio-plugin.patch

4214ee
From 64d7cccf48aee9a07e2e4c5237034638cae30391 Mon Sep 17 00:00:00 2001
4214ee
From: Daniel J Walsh <dwalsh@redhat.com>
4214ee
Date: Wed, 29 Aug 2018 06:51:21 -0400
4214ee
Subject: [PATCH] [crio] Add support for gathering information on cri-o
4214ee
 containers
4214ee
4214ee
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
4214ee
---
4214ee
 sos/plugins/crio.py | 74 +++++++++++++++++++++++++++++++++++++++++++++
4214ee
 1 file changed, 74 insertions(+)
4214ee
 create mode 100644 sos/plugins/crio.py
4214ee
4214ee
diff --git a/sos/plugins/crio.py b/sos/plugins/crio.py
4214ee
new file mode 100644
4214ee
index 00000000..f3e9d842
4214ee
--- /dev/null
4214ee
+++ b/sos/plugins/crio.py
4214ee
@@ -0,0 +1,74 @@
4214ee
+# Copyright (C) 2018 Red Hat, Inc. Daniel Walsh <dwalsh@redhat.com>
4214ee
+
4214ee
+# This file is part of the sos project: https://github.com/sosreport/sos
4214ee
+#
4214ee
+# This copyrighted material is made available to anyone wishing to use,
4214ee
+# modify, copy, or redistribute it subject to the terms and conditions of
4214ee
+# version 2 of the GNU General Public License.
4214ee
+#
4214ee
+# See the LICENSE file in the source distribution for further information.
4214ee
+
4214ee
+from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
4214ee
+
4214ee
+
4214ee
+class CRIO(Plugin):
4214ee
+
4214ee
+    """CRI-O containers
4214ee
+    """
4214ee
+
4214ee
+    plugin_name = 'crio'
4214ee
+    profiles = ('container',)
4214ee
+    packages = ('cri-o', "cri-tools")
4214ee
+
4214ee
+    option_list = [
4214ee
+        ("all", "enable capture for all containers, even containers "
4214ee
+            "that have terminated", 'fast', False),
4214ee
+        ("logs", "capture logs for running containers",
4214ee
+            'fast', False),
4214ee
+    ]
4214ee
+
4214ee
+    def setup(self):
4214ee
+        self.add_copy_spec([
4214ee
+            "/etc/containers/registries.conf",
4214ee
+            "/etc/containers/storage.conf",
4214ee
+            "/etc/containers/mounts.conf",
4214ee
+            "/etc/containers/policy.json",
4214ee
+            "/etc/crio/crio.conf",
4214ee
+            "/etc/crio/seccomp.json",
4214ee
+            "/etc/systemd/system/cri-o.service",
4214ee
+        ])
4214ee
+
4214ee
+        subcmds = [
4214ee
+            'info',
4214ee
+            'images',
4214ee
+            'pods',
4214ee
+            'ps',
4214ee
+            'ps -a',
4214ee
+            'stats',
4214ee
+            'version',
4214ee
+        ]
4214ee
+
4214ee
+        self.add_cmd_output(["crictl %s" % s for s in subcmds])
4214ee
+        self.add_journal(units="cri-o")
4214ee
+        self.add_cmd_output("ls -alhR /etc/cni")
4214ee
+
4214ee
+        ps_cmd = 'crictl ps --quiet'
4214ee
+        if self.get_option('all'):
4214ee
+            ps_cmd = "%s -a" % ps_cmd
4214ee
+
4214ee
+        img_cmd = 'cri-o images --quiet'
4214ee
+        insp = set()
4214ee
+
4214ee
+        for icmd in [ps_cmd, img_cmd]:
4214ee
+            result = self.get_command_output(icmd)
4214ee
+            if result['status'] == 0:
4214ee
+                for con in result['output'].splitlines():
4214ee
+                    insp.add(con)
4214ee
+
4214ee
+        if insp:
4214ee
+            for container in insp:
4214ee
+                self.add_cmd_output("crictl inspect %s" % container)
4214ee
+                if self.get_option('logs'):
4214ee
+                    self.add_cmd_output("crictl logs -t %s" % container)
4214ee
+
4214ee
+# vim: set et ts=4 sw=4 :
4214ee
-- 
4214ee
2.17.2
4214ee
4214ee
From 36a82723dfc2734b18eede4b75708595345c9d7a Mon Sep 17 00:00:00 2001
4214ee
From: Jake Hunsaker <jhunsake@redhat.com>
4214ee
Date: Mon, 25 Feb 2019 11:50:50 -0500
4214ee
Subject: [PATCH] [crio] Add tagging classes
4214ee
4214ee
Adds tagging classes so plugin will run on Red Hat and Ubuntu based
4214ee
systems.
4214ee
4214ee
Resolves: #1578
4214ee
4214ee
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
4214ee
---
4214ee
 sos/plugins/crio.py | 2 +-
4214ee
 1 file changed, 1 insertion(+), 1 deletion(-)
4214ee
4214ee
diff --git a/sos/plugins/crio.py b/sos/plugins/crio.py
4214ee
index f3e9d842..7afdf047 100644
4214ee
--- a/sos/plugins/crio.py
4214ee
+++ b/sos/plugins/crio.py
4214ee
@@ -11,7 +11,7 @@
4214ee
 from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
4214ee
 
4214ee
 
4214ee
-class CRIO(Plugin):
4214ee
+class CRIO(Plugin, RedHatPlugin, UbuntuPlugin):
4214ee
 
4214ee
     """CRI-O containers
4214ee
     """
4214ee
-- 
4214ee
2.17.2
4214ee