diff options
-rw-r--r-- | sos/plugins/kubernetes.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sos/plugins/kubernetes.py b/sos/plugins/kubernetes.py index 07efc296..2d0b5552 100644 --- a/sos/plugins/kubernetes.py +++ b/sos/plugins/kubernetes.py @@ -69,7 +69,9 @@ class kubernetes(Plugin, RedHatPlugin): # get all namespaces in use kn = self.get_command_output('%s get namespaces' % kube_cmd) - knsps = [n.split()[0] for n in kn['output'].splitlines()[1:] if n] + # namespace is the 1st word on line, until the line has spaces only + kn_output = kn['output'].splitlines()[1:] + knsps = [n.split()[0] for n in kn_output if n and len(n.split())] resources = [ 'deployments', |