Blame SOURCES/sos-bz2175650-microshift-plugin-oc-command.patch

f3f61a
From ff5e73b29b1fcc4c5531654d4f67f808408aa989 Mon Sep 17 00:00:00 2001
f3f61a
From: Pablo Acevedo Montserrat <pacevedo@redhat.com>
f3f61a
Date: Thu, 2 Mar 2023 12:12:06 +0100
f3f61a
Subject: [PATCH] [microshift] Fix microshift get and add commands
f3f61a
f3f61a
Drop microshift get usage in favor of oc get commands.
f3f61a
Add version and show-config commands before running inspect.
f3f61a
f3f61a
Closes https://issues.redhat.com/browse/USHIFT-932
f3f61a
f3f61a
Signed-off-by: Pablo Acevedo Montserrat <pacevedo@redhat.com>
f3f61a
---
f3f61a
 sos/report/plugins/microshift.py | 9 +++++++--
f3f61a
 1 file changed, 7 insertions(+), 2 deletions(-)
f3f61a
f3f61a
diff --git a/sos/report/plugins/microshift.py b/sos/report/plugins/microshift.py
f3f61a
index 953eb88e..69981d63 100644
f3f61a
--- a/sos/report/plugins/microshift.py
f3f61a
+++ b/sos/report/plugins/microshift.py
f3f61a
@@ -86,9 +86,10 @@ class Microshift(Plugin, RedHatPlugin):
f3f61a
 
f3f61a
     def _get_namespaces(self):
f3f61a
         res = self.exec_cmd(
f3f61a
-            'microshift get namespaces'
f3f61a
+            'oc get namespaces'
f3f61a
             ' -o custom-columns=NAME:.metadata.name'
f3f61a
-            ' --no-headers')
f3f61a
+            ' --no-headers'
f3f61a
+            ' --kubeconfig=%s' % self.get_option('kubeconfig'))
f3f61a
         if res['status'] == 0:
f3f61a
             return self._reduce_namespace_list(res['output'].split('\n'))
f3f61a
         return []
f3f61a
@@ -146,6 +147,10 @@ class Microshift(Plugin, RedHatPlugin):
f3f61a
         which is used to retrieve all API resources from the cluster.
f3f61a
         """
f3f61a
         self.add_forbidden_path('/var/lib/microshift')
f3f61a
+        self.add_cmd_output([
f3f61a
+            'microshift version',
f3f61a
+            'microshift show-config -m effective'
f3f61a
+        ])
f3f61a
 
f3f61a
         _cluster_resources_to_collect = ",".join(
f3f61a
             self._get_cluster_resources())
f3f61a
-- 
f3f61a
2.39.2
f3f61a