cdfmlr opened a new pull request, #1983: URL: https://github.com/apache/libcloud/pull/1983
## Enhance `KubeVirtNodeDriver` Compute Driver ### Description This pull request brings several improvements to the `create_node` method and related functions within the `KubeVirtNodeDriver` (`libcloud/compute/drivers/kubevirt.py`). **Features added to `KubeVirtNodeDriver.create_node`**: - Improved compatibility with the base `NodeDriver` class: - Added support for the `size: NodeSize` parameter, while retaining legacy compatibility with `ex_cpu` and `ex_memory`. - Added support for the `auth: NodeAuthSSHKey|NodeAuthPassword` parameter. - Support for deployment (`deploy_node`): - `KubeVirtNodeDriver` now supports node deployment automatically, benefiting from the above compatibility changes. - Support for general volume (disks) types that KubeVirt supports: - (==Breaking change==) Modified the content of the `ex_disks` parameter to align with the related [KubeVirt API](https://kubevirt.io/user-guide/virtual_machines/disks_and_volumes/), making it compatible with any volume types rather than hardcoded support for limited volume or disk types (previously only `persistentVolumeClaim` was supported). - Added support for the `ex_template` parameter, allowing users to customize the entire Kubernetes object declaring the virtual machine. This is particularly useful for: - Supporting advanced configurations not covered by other parameters. - Facilitating the reuse of existing virtual machine configurations. **Fixes**: - `_to_node`: Improved the logic for parsing memory, eliminating crashes on virtual machines with more than 1 GiB RAM. - `create_node`: (==Breaking change==) Renamed the parameter from `ports` to `ex_ports`. - ~~Addressed various bugs in the `create_node` method, which were eliminated during the refactor and implementation of new features.~~ **Other Changes**: - `libcloud/compute/drivers/kubevirt.py`: - Added a `KubeVirtNodeSize` function to assist in constructing `NodeSize` instances for `KubeVirtNodeDriver`. - Introduced a `KubeVirtNodeImage` function to help construct `NodeImage` instances for `KubeVirtNodeDriver`. - Code reorganization: Moved `DISK_TYPES` out of the `create_node` and exported it, enabling users to access a list of supported disk types. - Updated docstrings for new features, adhering to sphinx grammar standards. - `libcloud/test/compute/test_kubevirt.py`: - Introduced tests for the `create_node` method: This method was not tested previously. ### Status - done, ready for review ### Checklist (tick everything that applies) - [x] [Code linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide) (required, can be done after the PR checks) - [x] Documentation - [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html) - [ ] [ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes) (required for bigger changes) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@libcloud.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org