aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/collector/clusters/ocp.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/sos/collector/clusters/ocp.py b/sos/collector/clusters/ocp.py
index 812c65b3..e0db93d3 100644
--- a/sos/collector/clusters/ocp.py
+++ b/sos/collector/clusters/ocp.py
@@ -69,7 +69,8 @@ class ocp(Cluster):
('role', 'master', 'Colon delimited list of roles to filter on'),
('kubeconfig', '', 'Path to the kubeconfig file'),
('token', '', 'Service account token to use for oc authorization'),
- ('with-api', False, 'Collect OCP API data from a master node')
+ ('with-api', False, 'Collect OCP API data from a master node'),
+ ('api-url', '', 'Alternate API URL of an external control-plane'),
]
@property
@@ -109,8 +110,9 @@ class ocp(Cluster):
token
"""
_res = self.exec_primary_cmd(
- self.fmt_oc_cmd("login --insecure-skip-tls-verify=True --token=%s"
- % self.token)
+ self.fmt_oc_cmd("login --insecure-skip-tls-verify=True "
+ f"--token={self.token} "
+ f"{self.get_option('api-url')}")
)
return _res['status'] == 0