k8s_exec: reuse existing connection (#76)

Initialize the CoreV1Api object with the existing Kubernetes connection.
This commit is contained in:
Gonéri Le Bouder
2021-04-22 12:50:40 -04:00
committed by GitHub
parent 9a529fc8f3
commit c516d7ecb9

View File

@@ -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 = {}