Fixes for updated dependencies

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2017-09-29 14:18:19 +02:00
parent 98dbfeee76
commit 0082310aa5
7 changed files with 72 additions and 55 deletions

View File

@ -65,10 +65,12 @@ func (s pluginRegistryService) ResolveRepository(name reference.Named) (repoInfo
return
}
func newRegistryService() registry.Service {
return pluginRegistryService{
Service: registry.NewService(registry.ServiceOptions{V2Only: true}),
func newRegistryService() (registry.Service, error) {
svc, err := registry.NewService(registry.ServiceOptions{V2Only: true})
if err != nil {
return nil, err
}
return pluginRegistryService{Service: svc}, nil
}
func buildPullConfig(ctx context.Context, dockerCli *command.DockerCli, opts pluginOptions, cmdName string) (types.PluginInstallOptions, error) {
@ -96,7 +98,11 @@ func buildPullConfig(ctx context.Context, dockerCli *command.DockerCli, opts plu
}
ctx := context.Background()
trusted, err := image.TrustedReference(ctx, dockerCli, nt, newRegistryService())
svc, err := newRegistryService()
if err != nil {
return types.PluginInstallOptions{}, err
}
trusted, err := image.TrustedReference(ctx, dockerCli, nt, svc)
if err != nil {
return types.PluginInstallOptions{}, err
}