aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames O. D. Hunt <james.o.hunt@intel.com>2018-05-17 08:34:29 +0100
committerBryn M. Reeves <bmr@redhat.com>2018-05-24 15:30:08 +0100
commit29201835c256646569b6e703aed5d4e345b00507 (patch)
tree869075f048a47fc646d4aa4946a76e9dd81310ce
parent99fc28b640ccadde37f83d87fcffba098a244253 (diff)
downloadsos-29201835c256646569b6e703aed5d4e345b00507.tar.gz
[kata_containers] Add new plugin for Kata Containers
Add a new plugin for the Kata Containers project runtime (`kata-runtime`). See: - https://github.com/kata-containers - https://katacontainers.io/ Resolves: #1298 Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/kata_containers.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/sos/plugins/kata_containers.py b/sos/plugins/kata_containers.py
new file mode 100644
index 00000000..cf7b1bbe
--- /dev/null
+++ b/sos/plugins/kata_containers.py
@@ -0,0 +1,53 @@
+# This file is part of the sos project: https://github.com/sosreport/sos
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions of
+# version 2 of the GNU General Public License.
+#
+# See the LICENSE file in the source distribution for further information.
+
+from sos.plugins import (Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin,
+ SuSEPlugin)
+
+
+class KataContainers(Plugin, RedHatPlugin, DebianPlugin,
+ UbuntuPlugin, SuSEPlugin):
+ """Kata Containers configuration
+ """
+
+ plugin_name = 'kata_containers'
+ profiles = ('system', 'virt', 'container')
+ packages = ('kata-runtime',)
+
+ def setup(self):
+ self.limit = self.get_option('log_size')
+
+ if self.get_option('all_logs'):
+ # no limit on amount of data recorded
+ self.limit = None
+
+ self.add_cmd_output('kata-runtime kata-env')
+
+ config_files = set()
+
+ # start with the default file locations
+ config_files.add('/etc/kata-containers/configuration.toml')
+ config_files.add(
+ '/usr/share/defaults/kata-containers/configuration.toml')
+
+ # obtain a list of config files by asking the runtime
+ cmd = 'kata-runtime --kata-show-default-config-paths'
+ configs = self.get_command_output(cmd)
+ if configs and configs['status']:
+ for config in configs['output'].splitlines():
+ if config != "":
+ config_files.add(config)
+
+ self.add_copy_spec(config_files)
+
+ self.add_journal(identifier='kata-proxy')
+ self.add_journal(identifier='kata-shim')
+ self.add_journal(identifier='kata-runtime')
+ self.add_journal(units='kata-ksm-throttler')
+
+# vim: set et ts=4 sw=4 :