Current registry reference use a subset of dns and IPv4 addresses to
represent a registry domain.
Since registries are mostly compatible with rfc3986, that defines the
URI generic syntax, this adds support for IPv6 enclosed in squared
brackets based on the mentioned rfc.
The regexp is only expanded to match on IPv6 addreses enclosed between
square brackets, considering only regular IPv6 addresses represented
as compressed or uncompressed, excluding special IPv6 address
representations.
Signed-off-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
Allows having other parsers which are capable of unambiguously keeping domain and path separated in a Reference type.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This allows hostnames to contain uppercase characters, matching behavior
in Docker versions before 1.10. It does not attempt to canonicalize
hostnames into a lowercase format before parsing, since this could lead
to corner cases (for example, making Hostname.Domain.Com/ref ambiguous
on a daemon which contains references for both hostname.domain.com/ref
and Hostname.Domain.Com/ref).
Fixes: #1433
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
To resolve some inconsistencies between the grammar and the regular
expressions, the grammar has been slightly refactored to match the intent. The
regular expressions have been redefined with the same structure to make it
easier to verify the grammar is correct.
Signed-off-by: Stephen J Day <stephen.day@docker.com>
These functions allow a Named type to be combined with a tag or a
digest. WithTag will replace the ImageReference function in
github.com/docker/docker/utils as the Docker Engine transitions to the
reference package.
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
In order to support valid hostnames as name components, supporting repeated dash was added.
Additionally double underscore is now allowed as a separator to loosen the restriction for previously supported names.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)