From 607c120f9458ee5d2cfd6dd9d23757f4f1f2cd9a Mon Sep 17 00:00:00 2001 From: Sergey Date: Thu, 1 Apr 2021 16:33:27 +0300 Subject: [PATCH] Fix uppercase labels idempotency issue (#230) When we lower cases for all keys, but leave it original case for all values, we need to do the same with input labels. Add test. Fix #227 --- plugins/module_utils/podman/podman_container_lib.py | 2 +- .../podman_container_idempotency/tasks/idem_labels.yml | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/module_utils/podman/podman_container_lib.py b/plugins/module_utils/podman/podman_container_lib.py index d84d5d1..b1b427e 100644 --- a/plugins/module_utils/podman/podman_container_lib.py +++ b/plugins/module_utils/podman/podman_container_lib.py @@ -873,7 +873,7 @@ class PodmanContainerDiff: after = self.image_info.get('labels') or {} if self.params['label']: after.update({ - str(k).lower(): str(v).lower() + str(k).lower(): str(v) for k, v in self.params['label'].items() }) return self._diff_update_and_compare('label', before, after) diff --git a/tests/integration/targets/podman_container_idempotency/tasks/idem_labels.yml b/tests/integration/targets/podman_container_idempotency/tasks/idem_labels.yml index b7627fc..4d4f1fb 100644 --- a/tests/integration/targets/podman_container_idempotency/tasks/idem_labels.yml +++ b/tests/integration/targets/podman_container_idempotency/tasks/idem_labels.yml @@ -51,7 +51,9 @@ state: present label: haha: kukuku - llala: wiwiwiw + LLALA: WIWIWIW + OEIWIOP: eufslsa + ieui4: KDJSL4D command: 1h register: test4 @@ -65,7 +67,9 @@ state: present label: haha: kukuku - llala: wiwiwiw + LLALA: WIWIWIW + OEIWIOP: eufslsa + ieui4: KDJSL4D command: 1h register: test5