From 6ece9bed927f1f3aee9092a8a1521ebdc5f8f58d Mon Sep 17 00:00:00 2001 From: Santiago Sanchez Paz Date: Thu, 13 Aug 2020 18:07:16 +0200 Subject: [PATCH] util: Fix tracevol to use --config for oc only tracevol.py uses --config instead of --kubeconfig when invoked with -c kubectl and -k at the same time. Signed-off-by: Santiago Sanchez Paz --- troubleshooting/tools/tracevol.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/troubleshooting/tools/tracevol.py b/troubleshooting/tools/tracevol.py index b4fd524e8..022f34e98 100755 --- a/troubleshooting/tools/tracevol.py +++ b/troubleshooting/tools/tracevol.py @@ -502,9 +502,10 @@ def get_pv_data(arg, pvname): pvdata = {} cmd = [arg.command] if arg.kubeconfig != "": - cmd += ["--config", arg.kubeconfig] - else: - cmd += ["--kubeconfig", arg.kubeconfig] + if arg.command == "oc": + cmd += ["--config", arg.kubeconfig] + else: + cmd += ["--kubeconfig", arg.kubeconfig] cmd += ['get', 'pv', pvname, '-o', 'json'] out = subprocess.Popen(cmd, stdout=subprocess.PIPE,