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):
if '/' in private_port:
return port_settings.get(private_port)
h_ports = port_settings.get(private_port + '/tcp')
if h_ports is None:
h_ports = port_settings.get(private_port + '/udp')
for protocol in ['tcp', 'udp', 'sctp']:
h_ports = port_settings.get(private_port + '/' + protocol)
if h_ports:
break
return h_ports
......
......@@ -649,8 +649,8 @@ class ContainerCollection(Collection):
The keys of the dictionary are the ports to bind inside the
container, either as an integer or a string in the form
``port/protocol``, where the protocol is either ``tcp`` or
``udp``.
``port/protocol``, where the protocol is either ``tcp``,
``udp``, or ``sctp``.
The values of the dictionary are the corresponding ports to
open on the host, which can be either:
......
......@@ -7,7 +7,7 @@ PORT_SPEC = re.compile(
r"(?P<ext>[\d]*)(-(?P<ext_end>[\d]+))?:" # External 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
)
......
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