func newPluginDriver(name, home string, opts []string, pl plugingetter.CompatPlugin) (Driver, error) { if !pl.IsV1() { if p, ok := pl.(*v2.Plugin); ok { if p.PropagatedMount != "" { home = p.PluginObj.Config.PropagatedMount } } } proxy := &graphDriverProxy{name, pl} return proxy, proxy.Init(filepath.Join(home, name), opts) }
func newPluginDriver(name string, pl plugingetter.CompatPlugin, config Options) (Driver, error) { home := config.Root if !pl.IsV1() { if p, ok := pl.(*v2.Plugin); ok { if p.PropagatedMount != "" { home = p.PluginObj.Config.PropagatedMount } } } proxy := &graphDriverProxy{name, pl} return proxy, proxy.Init(filepath.Join(home, name), config.DriverOptions, config.UIDMaps, config.GIDMaps) }
// initPlugin initializes the authorization plugin if needed func (a *authorizationPlugin) initPlugin() error { // Lazy loading of plugins var err error a.once.Do(func() { if a.plugin == nil { var plugin plugingetter.CompatPlugin var e error if pg := GetPluginGetter(); pg != nil { plugin, e = pg.Get(a.name, AuthZApiImplements, plugingetter.Lookup) } else { plugin, e = plugins.Get(a.name, AuthZApiImplements) } if e != nil { err = e return } a.plugin = plugin.Client() } }) return err }
func newPluginDriver(name, home string, opts []string, pl plugingetter.CompatPlugin) (Driver, error) { proxy := &graphDriverProxy{name, pl.Client(), pl} return proxy, proxy.Init(filepath.Join(home, name), opts) }