From 295c702c730405c4bf6d6b7223f45d8790f0aca9 Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Fri, 22 Mar 2019 17:42:20 -0400 Subject: [kubernetes] Split out non-namespaced resources Removes non-namespaced resources from being iterated over by the namespace-sensitive loops such as describe. Resolves: #1618 Signed-off-by: Jake Hunsaker Signed-off-by: Bryn M. Reeves --- sos/plugins/kubernetes.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sos/plugins/kubernetes.py b/sos/plugins/kubernetes.py index 8045fe81..4ae51162 100644 --- a/sos/plugins/kubernetes.py +++ b/sos/plugins/kubernetes.py @@ -77,11 +77,8 @@ class kubernetes(Plugin, RedHatPlugin): 'deployments', 'ingresses', 'limitranges', - 'namespaces', 'pods', 'policies', - 'projects', - 'pv', 'pvc', 'rc', 'resourcequotas', @@ -89,13 +86,18 @@ class kubernetes(Plugin, RedHatPlugin): 'services' ] - # nodes and pvs are not namespaced, must pull separately. - # Also collect master metrics + # these are not namespaced, must pull separately. + global_resources = [ + 'namespaces', + 'nodes', + 'projects', + 'pvs' + ] self.add_cmd_output([ - "{} get -o json nodes".format(kube_cmd), - "{} get -o json pv".format(kube_cmd), - "{} get --raw /metrics".format(kube_cmd) + "%s get %s" % (kube_cmd, res) for res in global_resources ]) + # Also collect master metrics + self.add_cmd_output("%s get --raw /metrics" % kube_cmd) # CNV is not part of the base installation, but can be added if self.is_installed('kubevirt-virtctl'): -- cgit