Skip to content

Commit 31c1ccf

Browse files
Deprecate inventory plugin (#582)
Deprecate inventory plugin SUMMARY Deprecate inventory plugin ISSUE TYPE Bugfix Pull Request Docs Pull Request Feature Pull Request New Module Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Mike Graves <[email protected]> Reviewed-by: Bikouo Aubin
1 parent 031cc7c commit 31c1ccf

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deprecated_features:
2+
- k8s - the ``k8s`` inventory plugin has been deprecated and will be removed in release 4.0.0 (https://github.com/ansible-collections/kubernetes.core/issues/31).

meta/runtime.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ plugin_routing:
2020
inventory:
2121
openshift:
2222
redirect: community.okd.openshift
23+
k8s:
24+
deprecation:
25+
removal_version: 4.0.0
26+
warning_text: >-
27+
The k8s inventory plugin has been deprecated and
28+
will be removed in release 4.0.0.
2329
modules:
2430
k8s_auth:
2531
redirect: community.okd.k8s_auth

plugins/inventory/k8s.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
- Uses the kubectl connection plugin to access the Kubernetes cluster.
2020
- Uses k8s.(yml|yaml) YAML configuration file to set parameter values.
2121
22+
deprecated:
23+
removed_in: 4.0.0
24+
why: |
25+
As discussed in U(https://github.com/ansible-collections/kubernetes.core/issues/31), we decided to
26+
remove the k8s inventory plugin in release 4.0.0.
27+
alternative: "Use M(kubernetes.core.k8s_info) and M(ansible.builtin.add_host) instead."
28+
2229
options:
2330
plugin:
2431
description: token that ensures this is a source file for the 'k8s' plugin.
@@ -155,6 +162,12 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
155162

156163
def parse(self, inventory, loader, path, cache=True):
157164
super(InventoryModule, self).parse(inventory, loader, path)
165+
166+
self.display.deprecated(
167+
"The 'k8s' inventory plugin has been deprecated and will be removed in release 4.0.0",
168+
version="4.0.0",
169+
collection_name="kubernetes.core",
170+
)
158171
cache_key = self._get_cache_prefix(path)
159172
config_data = self._read_config_data(path)
160173
self.setup(config_data, cache, cache_key)

0 commit comments

Comments
 (0)