From 716e170821c628bbff533b95315ea236c331fe9f Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 19 Mar 2018 15:00:05 -0400 Subject: [PATCH] Auth method for the k8s lookup plugin now matches other modules (#37533) --- lib/ansible/module_utils/k8s/lookup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/k8s/lookup.py b/lib/ansible/module_utils/k8s/lookup.py index 6d175eaa63a..a05f3ca8120 100644 --- a/lib/ansible/module_utils/k8s/lookup.py +++ b/lib/ansible/module_utils/k8s/lookup.py @@ -88,8 +88,12 @@ class KubernetesLookup(object): self.kind = to_snake(self.kind) self.helper = self.get_helper(self.api_version, self.kind) + auth_args = ('host', 'api_key', 'kubeconfig', 'context', 'username', 'password', + 'cert_file', 'key_file', 'ssl_ca_cert', 'verify_ssl') + for arg in AUTH_ARG_SPEC: - self.connection[arg] = kwargs.get(arg) + if arg in auth_args and kwargs.get(arg) is not None: + self.connection[arg] = kwargs.get(arg) try: self.helper.set_client_config(**self.connection)