mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* Distinguish between [] and None.
* Add changelog fragment.
* Fix typo.
(cherry picked from commit 4e1f6683d9
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
8e7b779ec9
commit
59a7064392
3 changed files with 16 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "docker_container - fix idempotency problem with ``published_ports`` when strict comparison is used and list is empty (https://github.com/ansible-collections/community.general/issues/978)."
|
|
@ -2400,7 +2400,7 @@ class Container(DockerBaseClass):
|
||||||
return shlex.split(self.parameters.entrypoint)
|
return shlex.split(self.parameters.entrypoint)
|
||||||
|
|
||||||
def _get_expected_ports(self):
|
def _get_expected_ports(self):
|
||||||
if not self.parameters.published_ports:
|
if self.parameters.published_ports is None:
|
||||||
return None
|
return None
|
||||||
expected_bound_ports = {}
|
expected_bound_ports = {}
|
||||||
for container_port, config in self.parameters.published_ports.items():
|
for container_port, config in self.parameters.published_ports.items():
|
||||||
|
|
|
@ -2873,6 +2873,18 @@ avoid such warnings, please quote the value.' in log_options_2.warnings"
|
||||||
force_kill: yes
|
force_kill: yes
|
||||||
register: published_ports_5
|
register: published_ports_5
|
||||||
|
|
||||||
|
- name: published_ports (no published ports)
|
||||||
|
docker_container:
|
||||||
|
image: alpine:3.8
|
||||||
|
command: '/bin/sh -c "sleep 10m"'
|
||||||
|
name: "{{ cname }}"
|
||||||
|
state: started
|
||||||
|
published_ports: []
|
||||||
|
comparisons:
|
||||||
|
published_ports: strict
|
||||||
|
force_kill: yes
|
||||||
|
register: published_ports_6
|
||||||
|
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
docker_container:
|
docker_container:
|
||||||
name: "{{ cname }}"
|
name: "{{ cname }}"
|
||||||
|
@ -2887,6 +2899,7 @@ avoid such warnings, please quote the value.' in log_options_2.warnings"
|
||||||
- published_ports_3 is not changed
|
- published_ports_3 is not changed
|
||||||
- published_ports_4 is changed
|
- published_ports_4 is changed
|
||||||
- published_ports_5 is changed
|
- published_ports_5 is changed
|
||||||
|
- published_ports_6 is changed
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
## pull ############################################################
|
## pull ############################################################
|
||||||
|
|
Loading…
Reference in a new issue