Add test for targets/releases preference when pulling

Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: ca57f4e6a8ac7861009d03957e1b508036eac98f
Component: engine
This commit is contained in:
Riyaz Faizullabhoy
2016-03-09 00:18:30 -08:00
committed by cyli
parent 18495acb39
commit 39ea52c5c0
4 changed files with 61 additions and 2 deletions

View File

@ -339,6 +339,7 @@ func (cli *DockerCli) trustedPull(repoInfo *registry.RepositoryInfo, ref registr
if err != nil {
return notaryError(repoInfo.FullName(), err)
}
logrus.Debugf("retrieving target for %s role\n", t.Role)
r, err := convertTarget(t.Target)
if err != nil {
return err
@ -510,7 +511,6 @@ func (cli *DockerCli) addTargetToAllSignableRoles(repo *client.NotaryRepository,
// Also don't bother checking the keys if we can't add the target
// to this role due to path restrictions
if path.Dir(delegationRole.Name) != data.CanonicalTargetsRole || !delegationRole.CheckPaths(target.Name) {
fmt.Println("skipping", delegationRole.Name)
continue
}