We were testing to see if the cached metadata was nil, but we actually
set it to an empty data.Signed object, but didn't always set it to nil
if we failed to get local metadata.
Signed-off-by: Ying Li <ying.li@docker.com>
We use the cached timestamp for all other errors, so this makes the
error consistent. The only special metadata is the root.json, where a 404
signifies that the repository doesn't exist. Also update the message
when a cached timestamp is used.
Signed-off-by: Ying Li <ying.li@docker.com>
Updated the testutils/repo.go utility to be able to produce a repository with delegations
and to export metadata from said repo instead.
Signed-off-by: Ying Li <ying.li@docker.com>