Kaydet (Commit) 5d76e8e1 authored tarafından Hannes Ljungberg's avatar Hannes Ljungberg

Support sctp as protocol

Signed-off-by: 's avatarHannes Ljungberg <hannes@5monkeys.se>
üst e0024b5b
...@@ -915,9 +915,10 @@ class ContainerApiMixin(object): ...@@ -915,9 +915,10 @@ class ContainerApiMixin(object):
if '/' in private_port: if '/' in private_port:
return port_settings.get(private_port) return port_settings.get(private_port)
h_ports = port_settings.get(private_port + '/tcp') for protocol in ['tcp', 'udp', 'sctp']:
if h_ports is None: h_ports = port_settings.get(private_port + '/' + protocol)
h_ports = port_settings.get(private_port + '/udp') if h_ports:
break
return h_ports return h_ports
......
...@@ -649,8 +649,8 @@ class ContainerCollection(Collection): ...@@ -649,8 +649,8 @@ class ContainerCollection(Collection):
The keys of the dictionary are the ports to bind inside the The keys of the dictionary are the ports to bind inside the
container, either as an integer or a string in the form container, either as an integer or a string in the form
``port/protocol``, where the protocol is either ``tcp`` or ``port/protocol``, where the protocol is either ``tcp``,
``udp``. ``udp``, or ``sctp``.
The values of the dictionary are the corresponding ports to The values of the dictionary are the corresponding ports to
open on the host, which can be either: open on the host, which can be either:
......
...@@ -7,7 +7,7 @@ PORT_SPEC = re.compile( ...@@ -7,7 +7,7 @@ PORT_SPEC = re.compile(
r"(?P<ext>[\d]*)(-(?P<ext_end>[\d]+))?:" # External range r"(?P<ext>[\d]*)(-(?P<ext_end>[\d]+))?:" # External range
")?" ")?"
r"(?P<int>[\d]+)(-(?P<int_end>[\d]+))?" # Internal range r"(?P<int>[\d]+)(-(?P<int_end>[\d]+))?" # Internal range
"(?P<proto>/(udp|tcp))?" # Protocol "(?P<proto>/(udp|tcp|sctp))?" # Protocol
"$" # Match full string "$" # Match full string
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment