mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-03-26 19:03:16 +00:00
fix: Return early to avoid adding empty groups.
If no VMIs were found in a namespace then return early to avoid adding empty groups. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
@@ -448,6 +448,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
f"Error fetching VirtualMachineInstance list: {self.format_dynamic_api_exc(exc)}"
|
||||
) from exc
|
||||
|
||||
if not vmi_list.items:
|
||||
# Return early if no VMIs were found to avoid adding empty groups.
|
||||
return
|
||||
|
||||
services = self.get_ssh_services_for_namespace(client, namespace)
|
||||
|
||||
name = self._sanitize_group_name(name)
|
||||
|
||||
Reference in New Issue
Block a user