aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2018-09-04 12:07:34 -0400
committerBryn M. Reeves <bmr@redhat.com>2019-03-18 10:21:25 +0000
commit7a2e299db7d60a4a351febe83b6bc7f345d1a594 (patch)
treee504849e7878ec145c3d640c63b1d8a00e7faec3
parentc1d07e21459a3bc538cc61d10b1a6ba22bec03ba (diff)
downloadsos-7a2e299db7d60a4a351febe83b6bc7f345d1a594.tar.gz
[origin] Collect deploymentconfigs from additional namespaces
The origin plugin will now collect deploymentconfig output from more than just the 'default' namespace. Now it will collect from 'default', 'openshift-web-console', and 'openshift-ansible-broker' by default and a new 'all-namespaces' option has been added to allow deploymentconfig collection from all existing namespaces. Closes: #1410 Resolves: #1423 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/origin.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/sos/plugins/origin.py b/sos/plugins/origin.py
index 0e384117..75b24021 100644
--- a/sos/plugins/origin.py
+++ b/sos/plugins/origin.py
@@ -44,6 +44,8 @@ class OpenShiftOrigin(Plugin):
'fast', True),
("diag-prevent", "set --prevent-modification on 'oc adm diagnostics'",
'fast', False),
+ ("all-namespaces", "collect dc output for all namespaces", "fast",
+ False)
]
master_base_dir = "/etc/origin/master"
@@ -138,14 +140,29 @@ class OpenShiftOrigin(Plugin):
jcmds = [
"hostsubnet",
"clusternetwork",
- "netnamespaces",
- "dc -n default"
+ "netnamespaces"
]
self.add_cmd_output([
'%s get -o json %s' % (oc_cmd_admin, jcmd) for jcmd in jcmds
])
+ if self.get_option('all-namespaces'):
+ ocn = self.get_command_output('%s get namespaces'
+ % oc_cmd_admin)
+ ns_output = ocn['output'].splitlines()[1:]
+ nmsps = [n.split()[0] for n in ns_output if n]
+ else:
+ nmsps = [
+ 'default',
+ 'openshift-web-console',
+ 'openshift-ansible-service-broker'
+ ]
+
+ self.add_cmd_output([
+ '%s get -o json dc -n %s' % (oc_cmd_admin, n) for n in nmsps
+ ])
+
if self.get_option('diag'):
diag_cmd = "%s adm diagnostics -l 0" % oc_cmd_admin
if self.get_option('diag-prevent'):