Added Localdev Docs on changing microversion

Added some documentaition that details how to change the ironic localdev microversion for testing purposes.

Rendered View: https://files.mcaq.me/944ch.png

Change-Id: I1e21a12ad1413046a41f856ddf229e399f82523a
This commit is contained in:
Sharpz7 2024-10-04 21:12:28 +00:00 committed by Adam McArthur
parent 083ea91abf
commit 823a7c93bd

View File

@ -218,3 +218,53 @@ help with that, but are not an exhaustive troubleshooting guide::
. .tox/local-ironic-dev/bin/activate . .tox/local-ironic-dev/bin/activate
pip install -U -e . pip install -U -e .
Changing the Ironic Localdev Microversion
_________________________________________
Localdev supports testing against a specific microversion, which is useful
for testing backwards compatibility or evaluating external tools with
different versions of the API.
Steps to Change the Microversion
--------------------------------
To change the microversion, modify the ``ironic.conf.localdev`` file.
Instead of directly modifying the microversion, you should set the release
version corresponding to the microversion you intend to test. The mappings
between release versions and microversions (for the REST API) are maintained
in ``ironic/common/release_mappings.py``.
For example, to set the microversion to **16.2**, you would adjust
the ``pin_release_version`` parameter:
.. code-block:: ini
[DEFAULT]
# Set the release version corresponding to microversion 16.2
pin_release_version = 16.2
You can review the full configuration and release version mappings
in the `sample configuration documentation <https://docs.openstack.org/ironic/latest/configuration/sample-config.html>`_.
Resetting Localdev Setup
------------------------
After changing the microversion, you need to reset the local development environment.
1. Delete the existing database file:
.. code-block:: bash
rm -f ironic/ironic.sqlite
2. Reinstall Ironic in the virtual environment:
.. code-block:: bash
. .tox/local-ironic-dev/bin/activate
pip uninstall ironic
pip install -e .
This change ensures that the APIs from the selected Ironic version
will be applied, based on the release-to-microversion mapping in
the Ironic codebase.