mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-13 13:02:01 +00:00
refactoring for ansible_module.turbo integration (#313)
* refactoring for ansible_module.turbo integration This refactoring prepares the integration of `ansible_module.turbo` - Delay the loading of `common.py`, move the shared structure in `args_common`. - Avoid the use of one single object per module, this to increase the amount of Python structure that we can cache. - Cache the Kubernetes client. See: https://github.com/ansible-collections/community.kubernetes/pull/270 Co-authored-by: Jill Rouleau <jill.rouleau@bespokess.com>
This commit is contained in:
@@ -198,7 +198,7 @@ from ansible.errors import AnsibleError
|
||||
from ansible.module_utils.common._collections_compat import KeysView
|
||||
from ansible.plugins.lookup import LookupBase
|
||||
|
||||
from ansible_collections.community.kubernetes.plugins.module_utils.common import K8sAnsibleMixin
|
||||
from ansible_collections.community.kubernetes.plugins.module_utils.common import K8sAnsibleMixin, get_api_client
|
||||
|
||||
|
||||
try:
|
||||
@@ -235,7 +235,7 @@ class KubernetesLookup(K8sAnsibleMixin):
|
||||
|
||||
def run(self, terms, variables=None, **kwargs):
|
||||
self.params = kwargs
|
||||
self.client = self.get_api_client()
|
||||
self.client = get_api_client()
|
||||
|
||||
cluster_info = kwargs.get('cluster_info')
|
||||
if cluster_info == 'version':
|
||||
|
||||
Reference in New Issue
Block a user