Closed MorphBonehunter closed 6 years ago
I am able to replicate this.
[root@docker ~]# salt-call state.apply --local test
local:
----------
ID: docker_container_image_test
Function: docker_container.running
Name: testcase
Result: True
Comment:
Started: 19:31:10.578119
Duration: 395.22 ms
Changes:
----------
container_id:
----------
added:
c0ca5dc8703d4f7b0215c7e7b3f96195c20ff84e22f4134d30dd0a66992babd6
state:
----------
new:
running
old:
None
Summary for local
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Total run time: 395.220 ms
[root@docker ~]# docker inspect testcase -f '{{json .HostConfig.PortBindings}}'
{"1234/udp":[{"HostIp":"","HostPort":"1234"}]}
[root@docker ~]# docker inspect testcase -f '{{json .Config.ExposedPorts}}'
{"1234/udp/tcp":{}}
@terminalmage when you have a moment would you take a look at this?
Thanks, Daniel
@gtmanfred This is fixed in https://github.com/saltstack/salt/pull/45941, with a backport to 2017.7 in https://github.com/saltstack/salt/pull/45942. Can you test to confirm it works?
Works for me:
----------
ID: docker_container_image_test
Function: docker_container.running
Name: testcase
Result: True
Comment:
Started: 10:15:41.256096
Duration: 1427.329 ms
Changes:
----------
container_id:
----------
added:
352002d214eabe23aa1448c138373a48ce2043879970ae1d4981424339dcbc88
state:
----------
new:
running
old:
None
docker inspect testcase -f '{{json .HostConfig.PortBindings}}'
{"1234/udp":[{"HostIp":"","HostPort":"1234"}]}
docker inspect testcase -f '{{json .Config.ExposedPorts}}'
{"1234/udp":{}}
Thanks!
@gtmanfred do you want to also confirm the fix or can i close this issue?
@MorphBonehunter You can close the issue. Since I'm here, I can grab it. But in the future, feel free to close your issues if they're resolved. Thank you!
This is a follow up to #29662 as this is closed.
The Problem still exists in latest Saltstack release. If you try to use udp ports with the
port_bindings
Parameter it doesn't work and must be workarounded with an additionalports
Parameter.Testcase:
creates following container:
nothing is listening on the host:
docker inspect:
so change the testcase:
salt generates following changes:
after that following container is running:
listen on the host:
docker inspect: