From: Varsha Rao Date: Thu, 17 Sep 2020 06:59:40 +0000 (+0530) Subject: mgr/rook: Pass pod namespace to list_namespaced_pod() X-Git-Tag: v16.1.0~1026^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37213%2Fhead;p=ceph.git mgr/rook: Pass pod namespace to list_namespaced_pod() As list_namespaced_pod method requires pod namespace instead of cluster name. Fixes: https://tracker.ceph.com/issues/47511 Signed-off-by: Varsha Rao --- diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 64fcff99c8d..984f474022b 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -126,7 +126,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): return False, "ceph-mgr not running in Rook cluster" try: - self.k8s.list_namespaced_pod(self._rook_env.cluster_name) + self.k8s.list_namespaced_pod(self._rook_env.namespace) except ApiException as e: return False, "Cannot reach Kubernetes API: {}".format(e) else: @@ -169,13 +169,10 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): if self._rook_env.has_namespace(): config.load_incluster_config() - cluster_name = self._rook_env.cluster_name else: self.log.warning("DEVELOPMENT ONLY: Reading kube config from ~") config.load_kube_config() - cluster_name = "rook-ceph" - # So that I can do port forwarding from my workstation - jcsp from kubernetes.client import configuration configuration.verify_ssl = False @@ -188,7 +185,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): # this context, or subsequent API usage from handle_command # fails with SSLError('bad handshake'). Suspect some kind of # thread context setup in SSL lib? - self._k8s_CoreV1_api.list_namespaced_pod(cluster_name) + self._k8s_CoreV1_api.list_namespaced_pod(self._rook_env.namespace) except ApiException: # Ignore here to make self.available() fail with a proper error message pass