Do not load user kube config if path specified (#49952)

This commit is contained in:
Alan Rominger 2019-01-11 12:26:53 -05:00 committed by John R Barker
commit be5b7889f9
3 changed files with 7 additions and 2 deletions

View file

@ -165,7 +165,6 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable, K8sAnsibleM
self.fetch_objects(connections)
def fetch_objects(self, connections):
client = self.get_api_client()
if connections:
if not isinstance(connections, list):
@ -184,6 +183,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable, K8sAnsibleM
self.get_pods_for_namespace(client, name, namespace)
self.get_services_for_namespace(client, name, namespace)
else:
client = self.get_api_client()
name = self.get_default_host_name(client.configuration.host)
namespaces = self.get_available_namespaces(client)
for namespace in namespaces: