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