mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Fix IPv6 zone handling (#66)
* Support IPv6 zones (RFC 4007). * Add changelog fragment. * Remove change for docker_network. * Add IPv6 zone test. It looks like an arbitrary zone name works. If Docker daemon ever starts validating it (against what?) we either have to try to fix this test by a valid value, or remove it again.
This commit is contained in:
@@ -1756,7 +1756,7 @@ class TaskParameters(DockerBaseClass):
|
||||
elif p_len == 3:
|
||||
# We only allow IPv4 and IPv6 addresses for the bind address
|
||||
ipaddr = parts[0]
|
||||
if not re.match(r'^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$', parts[0]) and not re.match(r'^\[[0-9a-fA-F:]+\]$', ipaddr):
|
||||
if not re.match(r'^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$', parts[0]) and not re.match(r'^\[[0-9a-fA-F:]+(?:|%[^\]/]+)\]$', ipaddr):
|
||||
self.fail(('Bind addresses for published ports must be IPv4 or IPv6 addresses, not hostnames. '
|
||||
'Use the dig lookup to resolve hostnames. (Found hostname: {0})').format(ipaddr))
|
||||
if re.match(r'^\[[0-9a-fA-F:]+\]$', ipaddr):
|
||||
|
||||
Reference in New Issue
Block a user