Replace openshift client with kubernetes client (#96)

* Replace openshift client with kubernetes client

This commit primarily just removes mentions of openshift from the docs
and updates the requirements. Most of the work to replace the client has
been done through the following commits:

edc48ee577
c214376cac
48c5170018
2b6a989cf9

* Add changelog fragment

* Update changelogs/fragments/96-replace-openshift-client.yaml

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update plugins/modules/k8s.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update plugins/modules/k8s_info.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update plugins/modules/k8s_service.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Bump minimum kubernetes version to 12.0.0

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Mike Graves
2021-05-06 14:44:17 -04:00
committed by GitHub
parent 2b6a989cf9
commit 01a0815e56
17 changed files with 58 additions and 106 deletions

View File

@@ -37,7 +37,7 @@ DOCUMENTATION = '''
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the OpenShift client will attempt to load the default
options are provided, the Kubernetes client will attempt to load the default
configuration file from I(~/.kube/config). Can also be specified via K8S_AUTH_KUBECONFIG
environment variable.
context:
@@ -87,7 +87,7 @@ DOCUMENTATION = '''
requirements:
- "python >= 3.6"
- "openshift >= 0.6"
- "kubernetes >= 12.0.0"
- "PyYAML >= 3.11"
'''
@@ -121,7 +121,7 @@ from ansible_collections.kubernetes.core.plugins.module_utils.common import K8sA
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
try:
from openshift.dynamic.exceptions import DynamicApiError
from kubernetes.dynamic.exceptions import DynamicApiError
except ImportError:
pass
@@ -158,7 +158,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable, K8sAnsibleM
if not HAS_K8S_MODULE_HELPER:
raise K8sInventoryException(
"This module requires the OpenShift Python client. Try `pip install openshift`. Detail: {0}".format(k8s_import_exception)
"This module requires the Kubernetes Python client. Try `pip install kubernetes`. Detail: {0}".format(k8s_import_exception)
)
source_data = None