1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-03-22 02:29:08 +00:00

Fix idempotency when containers have a common network (#279)

Fix #252
This commit is contained in:
Sergey 2021-08-16 14:28:57 +03:00 committed by GitHub
parent 8ac0752283
commit afe55dd277
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 1 deletions

View file

@ -1076,6 +1076,11 @@ class PodmanContainerDiff:
net_mode_before = net_mode_before.replace('bridge', 'default')
net_mode_before = net_mode_before.replace('slirp4netns', 'default')
return self._diff_update_and_compare('network', net_mode_before, net_mode_after)
# If container is attached to network of a different container
if "container" in net_mode_before:
for netw in after:
if "container" in netw:
before = after = netw
before, after = sorted(list(set(before))), sorted(list(set(after)))
return self._diff_update_and_compare('network', before, after)