Merge pull request #28605 from cpuguy83/use_v2_for_graph_plugins

Allow graphdriver plugins to use v2
Upstream-commit: eb8fc5dcc3eecc9f645fae8194732747501398da
Component: engine
This commit is contained in:
Victor Vieux
2016-11-18 18:45:34 -08:00
committed by GitHub
2 changed files with 7 additions and 7 deletions

View File

@ -550,7 +550,12 @@ func NewDaemon(config *Config, registryService registry.Service, containerdRemot
driverName = config.GraphDriver
}
d.RegistryService = registryService
d.PluginStore = pluginstore.NewStore(config.Root)
// Plugin system initialization should happen before restore. Do not change order.
if err := d.pluginInit(config, containerdRemote); err != nil {
return nil, err
}
d.layerStore, err = layer.NewStoreFromOptions(layer.StoreOptions{
StorePath: config.Root,
@ -649,7 +654,6 @@ func NewDaemon(config *Config, registryService registry.Service, containerdRemot
Type: config.LogConfig.Type,
Config: config.LogConfig.Config,
}
d.RegistryService = registryService
d.EventsService = eventsService
d.volumes = volStore
d.root = config.Root
@ -668,11 +672,6 @@ func NewDaemon(config *Config, registryService registry.Service, containerdRemot
return nil, err
}
// Plugin system initialization should happen before restore. Do not change order.
if err := d.pluginInit(config, containerdRemote); err != nil {
return nil, err
}
if err := d.restore(); err != nil {
return nil, err
}

View File

@ -3,6 +3,7 @@ package graphdriver
import (
"fmt"
"io"
"path/filepath"
"github.com/docker/docker/pkg/plugingetter"
)
@ -26,5 +27,5 @@ func lookupPlugin(name, home string, opts []string, pg plugingetter.PluginGetter
func newPluginDriver(name, home string, opts []string, c pluginClient) (Driver, error) {
proxy := &graphDriverProxy{name, c}
return proxy, proxy.Init(home, opts)
return proxy, proxy.Init(filepath.Join(home, name), opts)
}