From e9c891c5c26a09ff4c25345030c0b716258fa9cb Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Tue, 7 Feb 2023 16:20:58 +0100 Subject: [PATCH] Deprecate the openshift inventory plugin (#186) * Deprecate the openshift inventory plugin Signed-off-by: Alina Buzachis * Fix indentation Signed-off-by: Alina Buzachis * Update docs Signed-off-by: Alina Buzachis --------- Signed-off-by: Alina Buzachis --- .../20230206-deprecate-openshift-inventory.yml | 2 ++ meta/runtime.yml | 7 +++++++ plugins/inventory/openshift.py | 10 ++++++++++ 3 files changed, 19 insertions(+) create mode 100644 changelogs/fragments/20230206-deprecate-openshift-inventory.yml diff --git a/changelogs/fragments/20230206-deprecate-openshift-inventory.yml b/changelogs/fragments/20230206-deprecate-openshift-inventory.yml new file mode 100644 index 0000000..efeb15a --- /dev/null +++ b/changelogs/fragments/20230206-deprecate-openshift-inventory.yml @@ -0,0 +1,2 @@ +deprecated_features: +- openshift - the ``openshift`` inventory plugin has been deprecated and will be removed in release 4.0.0 (https://github.com/ansible-collections/kubernetes.core/issues/31). diff --git a/meta/runtime.yml b/meta/runtime.yml index e1ab57a..230d4fa 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -17,6 +17,13 @@ plugin_routing: modules: k8s_auth: redirect: community.okd.openshift_auth + inventory: + openshift: + deprecation: + removal_version: 4.0.0 + warning_text: >- + The openshift inventory plugin has been deprecated and + will be removed in release 4.0.0. action: k8s: redirect: kubernetes.core.k8s_info diff --git a/plugins/inventory/openshift.py b/plugins/inventory/openshift.py index f69c652..940a585 100644 --- a/plugins/inventory/openshift.py +++ b/plugins/inventory/openshift.py @@ -17,6 +17,13 @@ DOCUMENTATION = ''' - Groups by cluster name, namespace, namespace_services, namespace_pods, namespace_routes, and labels - Uses openshift.(yml|yaml) YAML configuration file to set parameter values. + deprecated: + removed_in: 4.0.0 + why: | + As discussed in U(https://github.com/ansible-collections/kubernetes.core/issues/31), we decided to + remove the openshift inventory plugin in release 4.0.0. + alternative: "Use M(kubernetes.core.k8s_info) and M(ansible.builtin.add_host) instead." + options: plugin: description: token that ensures this is a source file for the 'openshift' plugin. @@ -141,6 +148,9 @@ class InventoryModule(K8sInventoryModule): self.check_kubernetes_collection() super(InventoryModule, self).fetch_objects(connections) + self.display.deprecated("The 'openshift' inventory plugin has been deprecated and will be removed in release 4.0.0", + version='4.0.0', collection_name='community.okd') + if connections: if not isinstance(connections, list): raise K8sInventoryException("Expecting connections to be a list.")