drivermanager: use correct plugin config types
This commit is contained in:
parent
a02308ee6a
commit
6f1777284d
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue