From c516d7ecb980b10a910c84346b8323fbe9b5d1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Thu, 22 Apr 2021 12:50:40 -0400 Subject: [PATCH] k8s_exec: reuse existing connection (#76) Initialize the CoreV1Api object with the existing Kubernetes connection. --- plugins/modules/k8s_exec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/k8s_exec.py b/plugins/modules/k8s_exec.py index 256d0384..c7f574fe 100644 --- a/plugins/modules/k8s_exec.py +++ b/plugins/modules/k8s_exec.py @@ -144,7 +144,7 @@ def argspec(): def execute_module(module, k8s_ansible_mixin): # Load kubernetes.client.Configuration - api = core_v1_api.CoreV1Api() + api = core_v1_api.CoreV1Api(k8s_ansible_mixin.client.client) # hack because passing the container as None breaks things optional_kwargs = {}