Skip to content

Commit

Permalink
Update plugingetter import path in docker/docker.
Browse files Browse the repository at this point in the history
Signed-off-by: Anusha Ragunathan <[email protected]>
  • Loading branch information
anusha-ragunathan committed Oct 11, 2016
1 parent 6175356 commit a98be03
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 50 deletions.
2 changes: 1 addition & 1 deletion daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ import (
"github.com/docker/docker/pkg/fileutils"
"github.com/docker/docker/pkg/graphdb"
"github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/pkg/plugingetter"
"github.com/docker/docker/pkg/progress"
"github.com/docker/docker/pkg/registrar"
"github.com/docker/docker/pkg/signal"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/sysinfo"
"github.com/docker/docker/pkg/system"
"github.com/docker/docker/pkg/truncindex"
plugingetter "github.com/docker/docker/plugin/getter"
pluginstore "github.com/docker/docker/plugin/store"
"github.com/docker/docker/reference"
"github.com/docker/docker/registry"
Expand Down
10 changes: 5 additions & 5 deletions daemon/graphdriver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/plugin/getter"
"github.com/docker/docker/pkg/plugingetter"
)

// FsMagic unsigned id of the filesystem in use.
Expand Down Expand Up @@ -135,11 +135,11 @@ func Register(name string, initFunc InitFunc) error {
}

// GetDriver initializes and returns the registered driver
func GetDriver(name, home string, options []string, uidMaps, gidMaps []idtools.IDMap, plugingetter getter.PluginGetter) (Driver, error) {
func GetDriver(name, home string, options []string, uidMaps, gidMaps []idtools.IDMap, pg plugingetter.PluginGetter) (Driver, error) {
if initFunc, exists := drivers[name]; exists {
return initFunc(filepath.Join(home, name), options, uidMaps, gidMaps)
}
if pluginDriver, err := lookupPlugin(name, home, options, plugingetter); err == nil {
if pluginDriver, err := lookupPlugin(name, home, options, pg); err == nil {
return pluginDriver, nil
}
logrus.Errorf("Failed to GetDriver graph %s %s", name, home)
Expand All @@ -156,10 +156,10 @@ func getBuiltinDriver(name, home string, options []string, uidMaps, gidMaps []id
}

// New creates the driver and initializes it at the specified root.
func New(root string, name string, options []string, uidMaps, gidMaps []idtools.IDMap, plugingetter getter.PluginGetter) (Driver, error) {
func New(root string, name string, options []string, uidMaps, gidMaps []idtools.IDMap, pg plugingetter.PluginGetter) (Driver, error) {
if name != "" {
logrus.Debugf("[graphdriver] trying provided driver: %s", name) // so the logs show specified driver
return GetDriver(name, root, options, uidMaps, gidMaps, plugingetter)
return GetDriver(name, root, options, uidMaps, gidMaps, pg)
}

// Guess for prior driver
Expand Down
6 changes: 3 additions & 3 deletions daemon/graphdriver/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"io"

"github.com/docker/docker/plugin/getter"
"github.com/docker/docker/pkg/plugingetter"
)

type pluginClient interface {
Expand All @@ -18,8 +18,8 @@ type pluginClient interface {
SendFile(string, io.Reader, interface{}) error
}

func lookupPlugin(name, home string, opts []string, pluginGetter getter.PluginGetter) (Driver, error) {
pl, err := pluginGetter.Get(name, "GraphDriver", getter.LOOKUP)
func lookupPlugin(name, home string, opts []string, pg plugingetter.PluginGetter) (Driver, error) {
pl, err := pg.Get(name, "GraphDriver", plugingetter.LOOKUP)
if err != nil {
return nil, fmt.Errorf("Error looking up graphdriver plugin %s: %v", name, err)
}
Expand Down
4 changes: 2 additions & 2 deletions daemon/graphdriver/plugin_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

package graphdriver

import "github.com/docker/docker/plugin/getter"
import "github.com/docker/docker/pkg/plugingetter"

func lookupPlugin(name, home string, opts []string, plugingetter getter.PluginGetter) (Driver, error) {
func lookupPlugin(name, home string, opts []string, pg plugingetter.PluginGetter) (Driver, error) {
return nil, ErrNotSupported
}
4 changes: 2 additions & 2 deletions layer/layer_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/docker/docker/daemon/graphdriver"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/pkg/plugingetter"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/plugin/getter"
"github.com/vbatts/tar-split/tar/asm"
"github.com/vbatts/tar-split/tar/storage"
)
Expand Down Expand Up @@ -45,7 +45,7 @@ type StoreOptions struct {
GraphDriverOptions []string
UIDMaps []idtools.IDMap
GIDMaps []idtools.IDMap
PluginGetter getter.PluginGetter
PluginGetter plugingetter.PluginGetter
}

// NewStoreFromOptions creates a new Store instance
Expand Down
26 changes: 0 additions & 26 deletions plugin/getter/interface.go

This file was deleted.

8 changes: 4 additions & 4 deletions plugin/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
package store

import (
"github.com/docker/docker/pkg/plugingetter"
"github.com/docker/docker/pkg/plugins"
"github.com/docker/docker/plugin/getter"
)

// GetAllByCap returns a list of plugins matching the given capability.
func (ps Store) GetAllByCap(capability string) ([]getter.CompatPlugin, error) {
func (ps Store) GetAllByCap(capability string) ([]plugingetter.CompatPlugin, error) {
pl, err := plugins.GetAll(capability)
if err != nil {
return nil, err
}
result := make([]getter.CompatPlugin, len(pl))
result := make([]plugingetter.CompatPlugin, len(pl))
for i, p := range pl {
result[i] = p
}
return result, nil
}

// Get returns a plugin matching the given name and capability.
func (ps Store) Get(name, capability string, _ int) (getter.CompatPlugin, error) {
func (ps Store) Get(name, capability string, _ int) (plugingetter.CompatPlugin, error) {
return plugins.Get(name, capability)
}

Expand Down
12 changes: 6 additions & 6 deletions plugin/store/store_experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/plugingetter"
"github.com/docker/docker/pkg/plugins"
"github.com/docker/docker/plugin/getter"
"github.com/docker/docker/plugin/v2"
"github.com/docker/docker/reference"
)
Expand Down Expand Up @@ -80,11 +80,11 @@ func (ps *Store) getByCap(name string, capability string) (*v2.Plugin, error) {
return p.FilterByCap(capability)
}

func (ps *Store) getAllByCap(capability string) []getter.CompatPlugin {
func (ps *Store) getAllByCap(capability string) []plugingetter.CompatPlugin {
ps.RLock()
defer ps.RUnlock()

result := make([]getter.CompatPlugin, 0, 1)
result := make([]plugingetter.CompatPlugin, 0, 1)
for _, p := range ps.plugins {
if _, err := p.FilterByCap(capability); err == nil {
result = append(result, p)
Expand Down Expand Up @@ -132,7 +132,7 @@ func (ps *Store) updatePluginDB() error {
}

// Get returns a plugin matching the given name and capability.
func (ps *Store) Get(name, capability string, mode int) (getter.CompatPlugin, error) {
func (ps *Store) Get(name, capability string, mode int) (plugingetter.CompatPlugin, error) {
var (
p *v2.Plugin
err error
Expand Down Expand Up @@ -176,8 +176,8 @@ func (ps *Store) Get(name, capability string, mode int) (getter.CompatPlugin, er
}

// GetAllByCap returns a list of plugins matching the given capability.
func (ps *Store) GetAllByCap(capability string) ([]getter.CompatPlugin, error) {
result := make([]getter.CompatPlugin, 0, 1)
func (ps *Store) GetAllByCap(capability string) ([]plugingetter.CompatPlugin, error) {
result := make([]plugingetter.CompatPlugin, 0, 1)

/* Daemon start always calls plugin.Init thereby initializing a store.
* So store on experimental builds can never be nil, even while
Expand Down
2 changes: 1 addition & 1 deletion volume/drivers/extpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"

"github.com/docker/docker/pkg/locker"
"github.com/docker/docker/plugin/getter"
getter "github.com/docker/docker/pkg/plugingetter"
"github.com/docker/docker/volume"
)

Expand Down

0 comments on commit a98be03

Please sign in to comment.