mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-15 19:58:28 +00:00
(cherry picked from commit 748d619fb2)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
c68d90de76
commit
c31fb79755
2
changelogs/fragments/637-swarm_info-endpoint_spec.yml
Normal file
2
changelogs/fragments/637-swarm_info-endpoint_spec.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- "docker_swarm_info - if ``service=true`` is used, do not crash when a service without an endpoint spec is encountered (https://github.com/ansible-collections/community.docker/issues/636, https://github.com/ansible-collections/community.docker/pull/637)."
|
||||||
@ -323,7 +323,7 @@ class DockerSwarmManager(DockerBaseClass):
|
|||||||
# Number of replicas have to be updated in calling method or may be left as None
|
# Number of replicas have to be updated in calling method or may be left as None
|
||||||
object_essentials['Replicas'] = None
|
object_essentials['Replicas'] = None
|
||||||
object_essentials['Image'] = item['Spec']['TaskTemplate']['ContainerSpec']['Image']
|
object_essentials['Image'] = item['Spec']['TaskTemplate']['ContainerSpec']['Image']
|
||||||
if 'Ports' in item['Spec']['EndpointSpec']:
|
if item['Spec'].get('EndpointSpec') and 'Ports' in item['Spec']['EndpointSpec']:
|
||||||
object_essentials['Ports'] = item['Spec']['EndpointSpec']['Ports']
|
object_essentials['Ports'] = item['Spec']['EndpointSpec']['Ports']
|
||||||
else:
|
else:
|
||||||
object_essentials['Ports'] = []
|
object_essentials['Ports'] = []
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user