When doing a container pull with no tag (or ":latest"):
> docker pull <registry>/<branch>/<job>
Before this patch, the "latest" tag was selected from all available
tags in /branches/<branch>, not from the tags available for that
specific container. As a consequence, if the container did not exist
in the latest tag, the "docker pull" or equivalent
command returned an error like:
> Error response from daemon: manifest for <img>:latest not found: manifest unknown: latest
Fix that by adding an optional "filter_names" argument to
Branch.get_tag(): when resolving a dynamic tag like "latest", tags
that are not part of filter_names are skipped.
In the container view, filter_names is set to
self.registry().job_tags(), because that method selects only the tags
available for the requested container (the tags where <job> exists AND
has a "container" format).
So, after this patch, the "latest" tag resolves to "the latest tag for
that container image". This is consistent with the output of the
/v2/<branch>/<job>/tags/list URL route.
The same logic is applied to the product view.
Signed-off-by: Julien Floret <julien.floret@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---