From 6f1777284da0880169c1b0bc4597858666a2f185 Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Tue, 18 Dec 2018 23:07:01 -0500 Subject: [PATCH] drivermanager: use correct plugin config types --- client/pluginmanager/drivermanager/instance.go | 4 ++-- client/pluginmanager/drivermanager/manager.go | 6 +++--- client/pluginmanager/drivermanager/manager_test.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client/pluginmanager/drivermanager/instance.go b/client/pluginmanager/drivermanager/instance.go index 76b86d6ff..a9f21eac6 100644 --- a/client/pluginmanager/drivermanager/instance.go +++ b/client/pluginmanager/drivermanager/instance.go @@ -42,7 +42,7 @@ type instanceManagerConfig struct { FetchReattach FetchPluginReattachFn // PluginConfig is the config passed to the launched plugins - PluginConfig *base.ClientAgentConfig + PluginConfig *base.AgentConfig // ID is the ID of the plugin being managed ID *loader.PluginID @@ -75,7 +75,7 @@ type instanceManager struct { fetchReattach FetchPluginReattachFn // pluginConfig is the config passed to the launched plugins - pluginConfig *base.ClientAgentConfig + pluginConfig *base.AgentConfig // id is the ID of the plugin being managed id *loader.PluginID diff --git a/client/pluginmanager/drivermanager/manager.go b/client/pluginmanager/drivermanager/manager.go index edd6043d6..76efd50da 100644 --- a/client/pluginmanager/drivermanager/manager.go +++ b/client/pluginmanager/drivermanager/manager.go @@ -29,7 +29,7 @@ type Manager interface { Dispense(driver string) (drivers.DriverPlugin, error) } -// EventHandler can is a callback to be called for a task. +// EventHandler is a callback to be called for a task. // The handler should not block execution. type EventHandler func(*drivers.TaskEvent) @@ -68,7 +68,7 @@ type Config struct { Loader loader.PluginCatalog // PluginConfig is the config passed to the launched plugins - PluginConfig *base.ClientAgentConfig + PluginConfig *base.AgentConfig // Updater is used to update the node when driver information changes Updater UpdateNodeDriverInfoFn @@ -103,7 +103,7 @@ type manager struct { loader loader.PluginCatalog // pluginConfig is the config passed to the launched plugins - pluginConfig *base.ClientAgentConfig + pluginConfig *base.AgentConfig // updater is used to update the node when device information changes updater UpdateNodeDriverInfoFn diff --git a/client/pluginmanager/drivermanager/manager_test.go b/client/pluginmanager/drivermanager/manager_test.go index 605bb0a1a..3e8de7014 100644 --- a/client/pluginmanager/drivermanager/manager_test.go +++ b/client/pluginmanager/drivermanager/manager_test.go @@ -33,7 +33,7 @@ func testSetup(t *testing.T) (chan *drivers.Fingerprint, chan *drivers.TaskEvent cfg := &Config{ Logger: testlog.HCLogger(t), Loader: cat, - PluginConfig: &base.ClientAgentConfig{}, + PluginConfig: &base.AgentConfig{}, Updater: noopUpdater, EventHandlerFactory: noopEventHandlerFactory, State: state.NoopDB{}, @@ -68,19 +68,19 @@ func mockCatalog(drivers map[string]drivers.DriverPlugin) *loader.MockCatalog { } return &loader.MockCatalog{ - DispenseF: func(name, pluginType string, cfg *base.ClientAgentConfig, logger log.Logger) (loader.PluginInstance, error) { + DispenseF: func(name, pluginType string, cfg *base.AgentConfig, logger log.Logger) (loader.PluginInstance, error) { d, ok := drivers[name] if !ok { return nil, fmt.Errorf("driver not found") } - return loader.MockBasicExternalPlugin(d), nil + return loader.MockBasicExternalPlugin(d, "0.1.0"), nil }, ReattachF: func(name, pluginType string, config *plugin.ReattachConfig) (loader.PluginInstance, error) { d, ok := drivers[name] if !ok { return nil, fmt.Errorf("driver not found") } - return loader.MockBasicExternalPlugin(d), nil + return loader.MockBasicExternalPlugin(d, "0.1.0"), nil }, CatalogF: func() map[string][]*base.PluginInfoResponse { return cat