Commit Graph
213 Commits
Author SHA1 Message Date
kubevirt-botandGitHub 131aacec43 Merge pull request #95 from 0xFelix/improved-docs
Provide links for docsite and improve docs by adding markup
2024-05-17 11:26:25 +02:00
kubevirt-botandGitHub 21c9bc8d4a Merge pull request #96 from jcanocan/add-inventory-tests
Add inventory unit tests
2024-05-17 11:24:25 +02:00
Javier Cano Cano 2b8767b424 test: add kubevirt inventory unit tests
Add unit tests for the following kubevirt functions:

- get_default_host_name
- get_host_from_service
- get_port_from_service
- parse
- fetch_objects
- get_cluster_domain
- get_available_namespaces
- get_vmis_for_namespace
- get_ssh_services_for_namespace
- set_ansible_host_and_port

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-05-15 17:41:50 +02:00
Javier Cano Cano a1b0971b7f fix(kubevirt): fix inventory labels loop
Fix the for loop ranging over vmi labels. This loop is missing the
.items() statement, which it causes the following error:

```
for key, value in vmi.metadata.labels:
ValueError: too many values to unpack (expected 2)
```

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-05-15 16:23:45 +02:00
Javier Cano Cano 48b2a81679 fix(kubevirt): comment typo
Fix a small comment typo showing `LoadBalancer` instead of `NodePort`.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-05-15 16:12:19 +02:00
Felix Matouschek 4851e5d20d docs: Improve docs by adding markup
Improve the generated documentations by adding Ansible documentation markup
where appropriate.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-05-08 11:06:57 +02:00
Felix Matouschek 0fd9f625ee docs: Provide links for docsite
Fill in the links.yml template and provide correct links and
communication channels for the collection.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-05-08 11:03:23 +02:00
kubevirt-botandGitHub 10d8c23138 Merge pull request #92 from jcanocan/add-template-tests
tests: add render_template unit tests
2024-04-29 10:54:05 +02:00
Javier Cano Cano 86d1d748df tests: add render_template unit tests
It adds unit tests for the render_template function. These test cases
cover all cases for non-mandatory fields in the VM template.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-04-29 10:27:52 +02:00
kubevirt-botandGitHub 13ceaf0f2d Merge pull request #91 from 0xFelix/wait-condition-info
feat(kubevirt_vm_info): Set wait_condition based on running
2024-04-25 14:06:24 +02:00
Felix Matouschek 71a88007fe feat(kubevirt_vm_info): Set wait_condition based on running
Add the running parameter to kubevirt_vm_info from which the
wait_condition is derived from when parameter wait is set to
yes.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-24 18:48:39 +02:00
Felix Matouschek 9d24aa878d cleanup: Run formatter on test_kubevirt_vm.py
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-24 18:38:51 +02:00
Felix MatouschekandGitHub 03fcea0072 Merge pull request #90 from 0xFelix/docs-connections
docs: Use proper type for connections parameter

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-24 16:32:57 +02:00
kubevirt-botandGitHub ce38c176a4 Merge pull request #86 from jcanocan/add-vm-delete-test
test: add kubevirt_vm delete test case
2024-04-24 16:08:25 +02:00
Javier Cano Cano 44936096ce test: add kubevirt_vm delete test case
Adds a test to assert deletion options are the expected.
Refactors python fixtures to reuse common fields in both create and
delete tests.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-04-24 15:57:32 +02:00
kubevirt-botandGitHub c13bdfbbaf Merge pull request #89 from 0xFelix/wait-condition
fix(kubevirt_vm): Set wait_condition based on running
2024-04-24 15:28:23 +02:00
Felix Matouschek 86cee0172f fix(kubevirt_vm): Set wait_condition based on running
To properly wait for a state change in the kubevirt_vm module the
wait_condition needs to adapted to the state of running.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-24 14:53:41 +02:00
Felix MatouschekandGitHub 81418d7a30 Merge pull request #88 from 0xFelix/cleanup-yaml
cleanup: Cleanup YAML passed to k8s module

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-24 14:53:08 +02:00
Felix Matouschek b232464dbe docs: Use proper type for connections parameter
The connections parameter is of type list of dicts.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-24 13:47:55 +02:00
Felix Matouschek e5edf072cc cleanup: Cleanup YAML passed to k8s module
Cleanup the YAML passed to the k8s module so it conforms to yaml output
you would expect from yaml.dump. Also refactor the tests to get rid of
duplicate definitions and make use of pytest.mark.parametrize and
yaml.dump.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-24 12:16:10 +02:00
kubevirt-botandGitHub 0531ac6c42 Merge pull request #85 from jcanocan/add-vm-info-test
test: add kubevirt_vm test cases
2024-04-19 09:04:04 +02:00
Javier Cano Cano 3814d1deb5 test: add kubevirt_vm test cases
Adds unit test to assert VM label and field selectors work as expected.
Refactors python fixtures to reuse defaults and avoid code duplication.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-04-18 17:01:30 +02:00
kubevirt-bot 8c7d55bb15 Update changelog for release 1.3.2
Signed-off-by: kubevirt-bot <kubevirtbot@redhat.com>
1.3.2
2024-04-17 13:24:51 +00:00
kubevirt-botandGitHub 0b24160331 Merge pull request #84 from 0xFelix/bump-ver
chore: Bump version to 1.3.2
2024-04-17 15:24:00 +02:00
Felix Matouschek 29ae157284 chore: Bump version to 1.3.2
Bump version once more and include appropriate changelogs this time.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-17 15:15:15 +02:00
kubevirt-bot 8d2bcd0613 Update changelog for release 1.3.1
Signed-off-by: kubevirt-bot <kubevirtbot@redhat.com>
1.3.1
2024-04-17 13:01:56 +00:00
kubevirt-botandGitHub 1fbd3cf4b4 Merge pull request #83 from 0xFelix/bump-ver
chore: Bump version to 1.3.1
2024-04-17 15:00:02 +02:00
Felix Matouschek e35dcf8d43 chore: Bump version to 1.3.1
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-17 14:44:17 +02:00
kubevirt-botandGitHub 8881e33b71 Merge pull request #82 from 0xFelix/testing-docs
chore: Update testing instructions
2024-04-17 12:21:59 +02:00
Felix Matouschek 161b219e3e chore: Update testing instructions
Update the testing instructions and file exclusions in galaxy.yml, so
they still make sense in a released version of this collection.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-17 11:53:30 +02:00
kubevirt-bot 88189f432b Update changelog for release 1.3.0
Signed-off-by: kubevirt-bot <kubevirtbot@redhat.com>
1.3.0
2024-04-16 16:49:05 +00:00
kubevirt-botandGitHub 613a1b75f0 Merge pull request #81 from 0xFelix/bump-ver-2
chore: Bump version to 1.3.0
2024-04-16 18:44:37 +02:00
Felix Matouschek c6306eef39 chore: Bump version to 1.3.0
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-16 18:34:06 +02:00
kubevirt-botandGitHub 67d579c363 Merge pull request #80 from 0xFelix/ansible-test-requirements
chore: Add requirements.txt for ansible-test units
2024-04-16 18:30:37 +02:00
Felix Matouschek ee7f99267c chore: Add requirements.txt for ansible-test units
Add the requirements.txt with requirements needed by ansible-test units.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-16 18:17:37 +02:00
kubevirt-botandGitHub b6c061fb9a Merge pull request #75 from 0xFelix/winrm
feat: Set ansible_connection to winrm for Windows hosts
2024-04-16 17:08:36 +02:00
Felix Matouschek a3abcbedd4 feat: Set ansible_connection to winrm for Windows hosts
This changes the inventory plugin so that it sets the ansible_connection
to winrm if it detected a Windows host. If it did not detect a Windows
host the ansible_connection is no longer set, so Ansible falls back to
its default value of ssh. The detection of SSH services for hosts using
winrm is disabled.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-16 16:38:54 +02:00
Felix Matouschek 7c5de4adf9 cleanup: Run make format
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-16 16:38:54 +02:00
kubevirt-botandGitHub 6cb279e3d1 Merge pull request #79 from 0xFelix/unit-pytest
Migrate existing unit tests to pytest and add basic unit tests for inventory plugin
2024-04-16 16:38:36 +02:00
Felix Matouschek 5ae19f9623 tests: Add basic unit tests for inventory plugin
Add a test file for the inventory plugin with some basic unit tests.
This file can be used to add more tests in the future.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-16 15:16:37 +02:00
Felix Matouschek 1947fe9ca8 cleanup: Reorganize unit tests
Reorganize unit tests so the directory structure looks like the
structure used in most other collections.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-15 13:58:08 +02:00
Felix Matouschek 9848f66036 cleanup: Migrate existing unit tests to pytest
Cleanup the existing unit tests and move them to pytest. By using pytest
it becomes easier to add new tests for existing functionality in the
collection.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-15 13:58:08 +02:00
kubevirt-botandGitHub afb8d178c2 Merge pull request #78 from 0xFelix/vscode-venv
Add helper to build virtualenv and vscode configuration
2024-04-15 12:19:59 +02:00
Felix Matouschek ac589abf5e chore: Add vscode configuration
Add vscode configuration that allows to develop, test and debug the
collection.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-12 10:29:58 +02:00
Felix Matouschek 55a6acef5d chore: Add tox-ansible configuration
Add tox-ansible configuration that allows to run tests with all
required ansible and python versions. Add Makefile targets to make use
of it.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-12 10:29:54 +02:00
Felix Matouschek e2d2da2670 chore: Add tox configuration
Add tox configuration that allows to build a venv for development and to
format source files. To make use of it add appropriate Makefile targets.

Drop unneeded requirements from requirements.txt and
test-requirements.txt and add needed requirements.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-12 10:23:38 +02:00
kubevirt-botandGitHub b392d8077d Merge pull request #77 from l3acon/add-composite-vars
fix: add composite vars to inventory
2024-04-09 17:23:56 +02:00
matt c058de50cd fix: add composite vars to inventory
Docs seem to indicate compose variables should work, but they aren't actually set.
Fix that by adding the composite variables to the inventory.

Signed-off-by: matt <l3acon@gmail.com>
2024-04-09 08:53:51 -06:00
kubevirt-botandGitHub 64a3136fde Merge pull request #76 from 0xFelix/service-network
feat: Give secondary interfaces a higher priority over services
2024-04-09 10:49:54 +02:00
Felix Matouschek 7dc7312a8b feat: Give secondary interfaces a higher priority over services
To give secondary interfaces a higher priority over services the use of
services is disabled if a network_name was provided.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-04-05 14:35:44 +02:00