aboutsummaryrefslogtreecommitdiff
path: root/ansible/module_utils/kolla_container_worker.py
AgeCommit message (Collapse)AuthorFilesLines
2026-09-03Fix compare_labels when image doesn't exist22.2.0Alex Welsh1-1/+4
check_image() from kolla_docker_worker returns None when the image doesn't exist locally. This means that when compare_labels tries to read a value from it, it will error out. This chain happens when comparing an image that doesn't exist locally. In the past we didn't hit this because checks ran sequentially and it would exit before hitting this. A recent change [1] means that now all checks run always. This patch fixes the issue in two ways. First, it makes the docker worker return an empty dict from check_image when it doesn't exist. Second, compare_labels now truthy-checks the output before proceeding, and returns straight away if it's False. [1] https://review.opendev.org/c/openstack/kolla-ansible/+/978162 Change-Id: I3c33ac3a474f80bca100005f61c1c0bfedc46170 Signed-off-by: Alex Welsh <alex@stackhpc.com> Closes-Bug: #2166024 (cherry picked from commit ffc50e8d33ade7a0d58ef83b79ed296a28b49608)
2026-05-06kolla_container: Return annotation of comparison failuresMichal Nasiadka1-26/+175
Assisted-By: Claude Sonnet 4.6 Change-Id: If6f09c727bc5c7af27786cdc92c998d653dd4ad1 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2025-10-28Bump ansible-core to 2.18/2.19Michal Nasiadka1-1/+1
Bumped collections in requirements-core.yml to Ansible 12 major versions, see [1]. [1]: https://github.com/ansible-community/ansible-build-data/blob/main/12/ansible-12.1.0.yaml Depends-On: https://review.opendev.org/c/openstack/kolla/+/960307 Co-authored-by: Doug Szumski doug@stackhpc.com Change-Id: If8a29052d8a43ffc0fef11514adabb5e4ab9d977 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2025-02-07Move actions to kolla_container_factsIvan Halomi1-24/+0
Move actions responsible for info about containers from kolla_container module to kolla_container_facts. Also fixes a bug with inconsistencies between docker and podman in kolla_container_facts. Closes-bug: #2084878 Change-Id: I1db88e28a828ebf073f018b2bae1d9556ec22807 Signed-off-by: Ivan Halomi <ivan.halomi@tietoevry.com> Signed-off-by: Martin Hiner <martin.hiner@tietoevry.com> Signed-off-by: Roman KrĨek <roman.krcek@tietoevry.com>
2024-09-05Set KOLLA_SERVICE_NAME in Podman containersMartin Hiner1-0/+11
Fixes issue in PodmanWorker where it didn't set KOLLA_SERVICE_NAME environment variable when creating new container. Additionally, two methods were moved from DockerWorker to ContainerWorker as they are applicable to both engines. Closes-Bug: #2078940 Change-Id: I273444fc828678d3c6803bce1bc8db1c5366b9b6 Signed-off-by: Martin Hiner <martin.hiner@tietoevry.com>
2024-08-21Remove "distutils" libraryleiyashuai1-3/+0
Library "distutils" is deprecated in Python 3.10: https://peps.python.org/pep-0632/ The versions previously referenced using StrictVersion should be old enough that they will not be used in a Dalmatian deployment: - Ansible 2.11 - Docker API 1.42, included since Docker engine 23.0.0 Change-Id: Ie315004715a1cb5a91dd54bc64b0a8fd0af650ec
2024-06-26Merge "Fix the docker container dimensions comparison for short notation"Zuul1-4/+75
2024-06-26Fix the docker container dimensions comparison for short notationPedro Henrique1-4/+75
When using short notations like `1g` or `512m` to define the container dimensions, we are always getting the container to being restarted in each kolla-ansible run, even with no real changes in the container configs. Change-Id: Ic8e2dd42b95a8f5c2141a820c55642a3ed7beabd Closes-Bug: #2070494
2024-04-22CI: Add codespell to pep8Michal Nasiadka1-1/+1
Fix existing spelling errors Change-Id: Ie689cf5a344aaa630a4860448b09242333a8e119
2023-02-20Refactor DockerWorker into ContainerWorkerIvan Halomi1-0/+499
Fourth part of patchset: https://review.opendev.org/c/openstack/kolla-ansible/+/799229/ which was suggested to be split into smaller patches. This commit refactors select methods from DockerWorker class into ContainerWorker class. New class contains Docker independent methods also used in Podman introduction and is inteded as a parent class for specific worker classes. Signed-off-by: Ivan Halomi <i.halomi@partner.samsung.com> Co-authored-by: Martin Hiner <m.hiner@partner.samsung.com> Change-Id: I2dd5920410dda053f2dfedc4e2666c56b1a7095a