ParseDockerRef normalizes the image reference following the docker
convention. This is added mainly for backward compatibility. The reference
returned can only be either tagged or digested. For reference contains both tag
and digest, the function returns digested reference, e.g.
docker.io/library/busybox:latest@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa
will be returned as
docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The common use case for this function is to add a default tag if the
reference only has a name. The current behavior only adds the default
tag if there is no *tag*, which requires most callers to check for a
digest. Change the behavior to only add default tags to name-only
references, and change the name to reflect this. The documentation
already described the new behavior, so it does not need to be changed.
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
The NormalizedNamed interface has shown to not be necessary for
integrating the change downstream. The FamiliarName and FamiliarString
helpers are the only used interface and allow hiding the normalized
completely.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Officials repositories always have 2 part names with the first part
being library and second part being the offical repository name. Names
with more than 2 parts should not hit the special case for official
repositories since they are not valid official repositories.
Add tests for this ambiguity and to ensure that 3 part names are
supports for the default repository, as used by the docker store.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
NamedRepository only needs to be used internally. Additionally this
interface may go away in the future and be merged with Named.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Add interface for for a normalized name and corresponding parser for that type.
New normalized versions of all interfaces are not added since all type information is preserved on calls to Familiar.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)