Blame SOURCES/sos-bz1823488-containers-common.patch

5d8d66
From 943b3c3cd096f8efaeb4f0f2008391abe4c9f7e2 Mon Sep 17 00:00:00 2001
5d8d66
From: Pavel Moravec <pmoravec@redhat.com>
5d8d66
Date: Sat, 2 May 2020 17:22:35 +0200
5d8d66
Subject: [PATCH] [containers_common] Add plugin for common containers configs
5d8d66
5d8d66
Move collection of whole /etc/containers and /usr/share/containers to
5d8d66
one containers_common plugin enabled by the package of the same name.
5d8d66
5d8d66
Since the package is a common dependency for buildah and podman, no regression
5d8d66
in default data collection happens.
5d8d66
5d8d66
Resolves: #2040
5d8d66
5d8d66
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
5d8d66
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
5d8d66
---
5d8d66
 sos/plugins/buildah.py           |  7 -------
5d8d66
 sos/plugins/containers_common.py | 27 +++++++++++++++++++++++++
5d8d66
 sos/plugins/podman.py            |  7 -------
5d8d66
 3 files changed, 27 insertions(+), 14 deletions(-)
5d8d66
 create mode 100644 sos/plugins/containers_common.py
5d8d66
5d8d66
diff --git a/sos/plugins/buildah.py b/sos/plugins/buildah.py
5d8d66
index 9d237a53..4b8b3b0a 100644
5d8d66
--- a/sos/plugins/buildah.py
5d8d66
+++ b/sos/plugins/buildah.py
5d8d66
@@ -20,13 +20,6 @@ class Buildah(Plugin, RedHatPlugin):
5d8d66
     profiles = ('container',)
5d8d66
 
5d8d66
     def setup(self):
5d8d66
-        self.add_copy_spec([
5d8d66
-            "/etc/containers/registries.conf",
5d8d66
-            "/etc/containers/storage.conf",
5d8d66
-            "/etc/containers/mounts.conf",
5d8d66
-            "/etc/containers/policy.json",
5d8d66
-        ])
5d8d66
-
5d8d66
         subcmds = [
5d8d66
             'containers',
5d8d66
             'containers --all',
5d8d66
diff --git a/sos/plugins/containers_common.py b/sos/plugins/containers_common.py
5d8d66
new file mode 100644
5d8d66
index 00000000..99ae88fe
5d8d66
--- /dev/null
5d8d66
+++ b/sos/plugins/containers_common.py
bceef4
@@ -0,0 +1,27 @@
5d8d66
+# Copyright (C) 2020 Red Hat, Inc., Pavel Moravec <pmoravec@redhat.com>
5d8d66
+
5d8d66
+# This file is part of the sos project: https://github.com/sosreport/sos
5d8d66
+#
5d8d66
+# This copyrighted material is made available to anyone wishing to use,
5d8d66
+# modify, copy, or redistribute it subject to the terms and conditions of
5d8d66
+# version 2 of the GNU General Public License.
5d8d66
+#
5d8d66
+# See the LICENSE file in the source distribution for further information.
5d8d66
+
5d8d66
+from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
5d8d66
+
5d8d66
+
5d8d66
+class ContainersCommon(Plugin, RedHatPlugin, UbuntuPlugin):
5d8d66
+
5d8d66
+    short_desc = 'Common container configs under {/etc,/usr/share}/containers'
5d8d66
+    plugin_name = 'containers_common'
5d8d66
+    profiles = ('container', )
5d8d66
+    packages = ('containers-common', )
5d8d66
+
5d8d66
+    def setup(self):
5d8d66
+        self.add_copy_spec([
5d8d66
+            '/etc/containers/*',
5d8d66
+            '/usr/share/containers/*',
5d8d66
+        ])
5d8d66
+
5d8d66
+# vim: set et ts=4 sw=4 :
5d8d66
diff --git a/sos/plugins/podman.py b/sos/plugins/podman.py
5d8d66
index f6875197..f6632776 100644
5d8d66
--- a/sos/plugins/podman.py
5d8d66
+++ b/sos/plugins/podman.py
5d8d66
@@ -27,13 +27,6 @@ class Podman(Plugin, RedHatPlugin, UbuntuPlugin):
5d8d66
     ]
5d8d66
 
5d8d66
     def setup(self):
5d8d66
-        self.add_copy_spec([
5d8d66
-            "/etc/containers/registries.conf",
5d8d66
-            "/etc/containers/storage.conf",
5d8d66
-            "/etc/containers/mounts.conf",
5d8d66
-            "/etc/containers/policy.json",
5d8d66
-        ])
5d8d66
-
5d8d66
         self.add_env_var([
5d8d66
             'HTTP_PROXY',
5d8d66
             'HTTPS_PROXY',
5d8d66
-- 
bceef4
diff --git a/sos/plugins/containers_common.py b/sos/plugins/containers_common.py
bceef4
--- a/sos/plugins/containers_common.py
bceef4
+++ b/sos/plugins/containers_common.py
bceef4
@@ -13,6 +13,8 @@ import os
bceef4
bceef4
bceef4
 class ContainersCommon(Plugin, RedHatPlugin, UbuntuPlugin):
bceef4
+    """Common container configs under {/etc,/usr/share}/containers
bceef4
+    """
bceef4
bceef4
     short_desc = 'Common container configs under {/etc,/usr/share}/containers'
bceef4
     plugin_name = 'containers_common'
bceef4
--
5d8d66
2.21.3
bceef4