Переглянути джерело

Pass plugingetter as part of swarm node config.

This is necessary for swarmkit to support cluster wide plugins, such as
globally scoped network plugins.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
Anusha Ragunathan 8 роки тому
батько
коміт
660a186e92
3 змінених файлів з 7 додано та 0 видалено
  1. 1 0
      daemon/cluster/cluster.go
  2. 1 0
      daemon/cluster/executor/backend.go
  3. 5 0
      daemon/daemon.go

+ 1 - 0
daemon/cluster/cluster.go

@@ -332,6 +332,7 @@ func (c *Cluster) startNewNode(conf nodeStartConfig) (*node, error) {
 		ElectionTick:       3,
 		ElectionTick:       3,
 		UnlockKey:          conf.lockKey,
 		UnlockKey:          conf.lockKey,
 		AutoLockManagers:   conf.autolock,
 		AutoLockManagers:   conf.autolock,
+		PluginGetter:       c.config.Backend.PluginGetter(),
 	})
 	})
 
 
 	if err != nil {
 	if err != nil {

+ 1 - 0
daemon/cluster/executor/backend.go

@@ -56,4 +56,5 @@ type Backend interface {
 	GetRepository(context.Context, reference.NamedTagged, *types.AuthConfig) (distribution.Repository, bool, error)
 	GetRepository(context.Context, reference.NamedTagged, *types.AuthConfig) (distribution.Repository, bool, error)
 	LookupImage(name string) (*types.ImageInspect, error)
 	LookupImage(name string) (*types.ImageInspect, error)
 	PluginManager() *plugin.Manager
 	PluginManager() *plugin.Manager
+	PluginGetter() *plugin.Store
 }
 }

+ 5 - 0
daemon/daemon.go

@@ -1270,6 +1270,11 @@ func (daemon *Daemon) PluginManager() *plugin.Manager { // set up before daemon
 	return daemon.pluginManager
 	return daemon.pluginManager
 }
 }
 
 
+// PluginGetter returns current pluginStore associated with the daemon
+func (daemon *Daemon) PluginGetter() *plugin.Store {
+	return daemon.PluginStore
+}
+
 // CreateDaemonRoot creates the root for the daemon
 // CreateDaemonRoot creates the root for the daemon
 func CreateDaemonRoot(config *Config) error {
 func CreateDaemonRoot(config *Config) error {
 	// get the canonical path to the Docker root directory
 	// get the canonical path to the Docker root directory