Update trust.go to reflect NotaryRepository API changes:
- Update now returns only an error - NewNotaryRepository now takes a trustpinning configuration - we will provide an empty one for now. Signed-off-by: cyli <cyli@twistedmatrix.com>
This commit is contained in:
parent
4710ed6304
commit
d869d2b0a0
|
@ -33,6 +33,7 @@ import (
|
||||||
"github.com/docker/notary/client"
|
"github.com/docker/notary/client"
|
||||||
"github.com/docker/notary/passphrase"
|
"github.com/docker/notary/passphrase"
|
||||||
"github.com/docker/notary/trustmanager"
|
"github.com/docker/notary/trustmanager"
|
||||||
|
"github.com/docker/notary/trustpinning"
|
||||||
"github.com/docker/notary/tuf/data"
|
"github.com/docker/notary/tuf/data"
|
||||||
"github.com/docker/notary/tuf/signed"
|
"github.com/docker/notary/tuf/signed"
|
||||||
"github.com/docker/notary/tuf/store"
|
"github.com/docker/notary/tuf/store"
|
||||||
|
@ -184,7 +185,9 @@ func (cli *DockerCli) getNotaryRepository(repoInfo *registry.RepositoryInfo, aut
|
||||||
modifiers = append(modifiers, transport.RequestModifier(auth.NewAuthorizer(challengeManager, tokenHandler, basicHandler)))
|
modifiers = append(modifiers, transport.RequestModifier(auth.NewAuthorizer(challengeManager, tokenHandler, basicHandler)))
|
||||||
tr := transport.NewTransport(base, modifiers...)
|
tr := transport.NewTransport(base, modifiers...)
|
||||||
|
|
||||||
return client.NewNotaryRepository(cli.trustDirectory(), repoInfo.FullName(), server, tr, cli.getPassphraseRetriever())
|
return client.NewNotaryRepository(
|
||||||
|
cli.trustDirectory(), repoInfo.FullName(), server, tr, cli.getPassphraseRetriever(),
|
||||||
|
trustpinning.TrustPinConfig{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertTarget(t client.Target) (target, error) {
|
func convertTarget(t client.Target) (target, error) {
|
||||||
|
@ -474,7 +477,7 @@ func (cli *DockerCli) trustedPush(repoInfo *registry.RepositoryInfo, ref referen
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the latest repository metadata so we can figure out which roles to sign
|
// get the latest repository metadata so we can figure out which roles to sign
|
||||||
_, err = repo.Update(false)
|
err = repo.Update(false)
|
||||||
|
|
||||||
switch err.(type) {
|
switch err.(type) {
|
||||||
case client.ErrRepoNotInitialized, client.ErrRepositoryNotExist:
|
case client.ErrRepoNotInitialized, client.ErrRepositoryNotExist:
|
||||||
|
|
Loading…
Reference in New Issue