feat(inventory): Deprecate connections parameter

Deprecate the connections parameter of the inventory plugin. For now
this adds only a warning message while keeping the functionality.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
Felix Matouschek
2024-07-10 13:45:11 +02:00
parent f6a43206a6
commit ff6a067c84

View File

@@ -39,6 +39,11 @@ options:
- Optional list of cluster connection settings. If no connections are provided, the default
I(~/.kube/config) and active context will be used, and objects will be returned for all namespaces
the active user is authorized to access.
deprecated:
removed_in: "3.0.0"
alternative:
- Split your connections into multiple configuration files and move parameters of each connection
to the configuration top level.
type: list
elements: dict
suboptions:
@@ -422,6 +427,12 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
fetch_objects populates the inventory with every configured connection.
"""
if connections:
self.display.deprecated(
msg="The 'connections' parameter is deprecated and starting with version 2.0.0 of kubevirt.core supports only a single entry.",
version="3.0.0",
collection_name="kubevirt.core",
)
if not isinstance(connections, list):
raise KubeVirtInventoryException("Expecting connections to be a list.")