Add the kubevirt_vmi_info module which allows to fetch information about
VirtualMachineInstance(s).
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Extract the execute_module function from the kubevirt_vm_info module to
make it available for other modules.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Run the integration tests for kubevirt_vm_info in a random namespace
and cleanup after the tests finish.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Run the integration tests for kubevirt_vm in a random namespace
and cleanup after the tests finish.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Run the integration tests for inventory_kubevirt in a random namespace
and cleanup after the tests finish.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Use the bundled common-instancetypes deployed by virt-operator instead
of deploying common-instancetypes manually.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Add renovate configuration to automatically update used software
versions in e2e-setup and the github actions used by this repository.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This change adds support for setting the RunStrategy of a VM.
Depending on the value set the wait condition for the VM is adjusted.
For the values Always, RerunOnFailure or Once the wait condition will
wait for the VM to run and be ready. For the value Halted the wait
condition will wait for the VM to not exist. For the value Manual
the wait condition is not set.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Mark all methods of the inventory which should be private with a underscore
prefix in their name.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Replace the remaining uses of addict's Dict with ResourceField of the
Kubernetes client. This allows to drop the dependency on addict.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Fix inventory source caching by separating the fetching of objects and
populating the inventory. This way objects can be fetched from the K8S
API or from a configured cached and the cache related parameters on the
plugin now actually work.
The inventory source cache was tested with the ansible.builtin.jsonfile
cache plugin and 100k hosts (~2G JSON file). Though it took a noticeable
amount of time for the inventory plugin to run it worked fine and no
failures could be observed.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Use dicts instead of ResourceFields where possible to allow
easier serialization/deserialization of objects fetched from the K8S
API.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
Align the version in which backwards compatibility for the connections
parameter will be removed.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
The support for connections to multiple clusters in the inventory
plugin is dropped to better align with user expectations and how other
inventories work. If inventories of multiple clusters are needed the
inventory can be run multiple times with different configurations.
This also helps to clean up the code and make it simpler.
For now this adds a compatibility helper so that configurations with a
single connection entry remain supported and a warning is emitted.
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
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>