diff --git a/client/config/config.go b/client/config/config.go index 241d65577..062a453a6 100644 --- a/client/config/config.go +++ b/client/config/config.go @@ -368,9 +368,9 @@ func (c *Config) ReadStringListToMapDefault(key, defaultValue string) map[string } // NomadPluginConfig produces the NomadConfig struct which is sent to Nomad plugins -func (c *Config) NomadPluginConfig() *base.NomadConfig { - return &base.NomadConfig{ - Driver: &base.NomadDriverConfig{ +func (c *Config) NomadPluginConfig() *base.ClientAgentConfig { + return &base.ClientAgentConfig{ + Driver: &base.ClientDriverConfig{ ClientMinPort: c.ClientMinPort, ClientMaxPort: c.ClientMaxPort, }, diff --git a/client/driver/executor/executor_test.go b/client/driver/executor/executor_test.go index 8fdabea46..490122de1 100644 --- a/client/driver/executor/executor_test.go +++ b/client/driver/executor/executor_test.go @@ -230,10 +230,7 @@ func TestUniversalExecutor_MakeExecutable(t *testing.T) { // Set its permissions to be non-executable f.Chmod(os.FileMode(0610)) - // Make a fake executor - executor := NewExecutor(testlog.HCLogger(t)).(*UniversalExecutor) - - err = executor.makeExecutable(f.Name()) + err = makeExecutable(f.Name()) if err != nil { t.Fatalf("makeExecutable() failed: %v", err) } diff --git a/client/fingerprint_manager_test.go b/client/fingerprint_manager_test.go index 7b0804399..9c97f3adb 100644 --- a/client/fingerprint_manager_test.go +++ b/client/fingerprint_manager_test.go @@ -585,11 +585,11 @@ func TestFingerprintManager_Run_DriverFailure(t *testing.T) { dispenseCalls := 0 loader := &loader.MockCatalog{ - DispenseF: func(name, pluginType string, logger log.Logger) (loader.PluginInstance, error) { + DispenseF: func(name, pluginType string, cfg *base.ClientAgentConfig, logger log.Logger) (loader.PluginInstance, error) { if pluginType == base.PluginTypeDriver && name == "raw_exec" { dispenseCalls++ } - return singLoader.Dispense(name, pluginType, logger) + return singLoader.Dispense(name, pluginType, cfg, logger) }, ReattachF: singLoader.Reattach, CatalogF: singLoader.Catalog, diff --git a/devices/gpu/nvidia/device.go b/devices/gpu/nvidia/device.go index 3359794de..c68971373 100644 --- a/devices/gpu/nvidia/device.go +++ b/devices/gpu/nvidia/device.go @@ -121,7 +121,7 @@ func (d *NvidiaDevice) ConfigSchema() (*hclspec.Spec, error) { } // SetConfig is used to set the configuration of the plugin. -func (d *NvidiaDevice) SetConfig(data []byte, cfg *base.NomadConfig) error { +func (d *NvidiaDevice) SetConfig(data []byte, cfg *base.ClientAgentConfig) error { var config Config if err := base.MsgPackDecode(data, &config); err != nil { return err diff --git a/drivers/exec/driver.go b/drivers/exec/driver.go index 4c788ab94..468b80890 100644 --- a/drivers/exec/driver.go +++ b/drivers/exec/driver.go @@ -73,7 +73,7 @@ type ExecDriver struct { config *Config // nomadConfig is the client config from nomad - nomadConfig *base.NomadDriverConfig + nomadConfig *base.ClientDriverConfig // tasks is the in memory datastore mapping taskIDs to execDriverHandles tasks *taskStore @@ -135,7 +135,7 @@ func (*ExecDriver) ConfigSchema() (*hclspec.Spec, error) { return configSpec, nil } -func (d *ExecDriver) SetConfig(data []byte, cfg *base.NomadConfig) error { +func (d *ExecDriver) SetConfig(data []byte, cfg *base.ClientAgentConfig) error { var config Config if err := base.MsgPackDecode(data, &config); err != nil { return err diff --git a/drivers/mock/driver.go b/drivers/mock/driver.go index 698133592..1e853f1ac 100644 --- a/drivers/mock/driver.go +++ b/drivers/mock/driver.go @@ -212,7 +212,7 @@ func (d *Driver) ConfigSchema() (*hclspec.Spec, error) { return configSpec, nil } -func (d *Driver) SetConfig(data []byte, cfg *base.NomadConfig) error { +func (d *Driver) SetConfig(data []byte, cfg *base.ClientAgentConfig) error { var config Config if err := base.MsgPackDecode(data, &config); err != nil { return err diff --git a/drivers/rawexec/driver.go b/drivers/rawexec/driver.go index c6afaaa51..9575409ef 100644 --- a/drivers/rawexec/driver.go +++ b/drivers/rawexec/driver.go @@ -106,7 +106,7 @@ type RawExecDriver struct { config *Config // nomadConfig is the client config from nomad - nomadConfig *base.NomadDriverConfig + nomadConfig *base.ClientDriverConfig // tasks is the in memory datastore mapping taskIDs to rawExecDriverHandles tasks *taskStore @@ -172,7 +172,7 @@ func (r *RawExecDriver) ConfigSchema() (*hclspec.Spec, error) { return configSpec, nil } -func (r *RawExecDriver) SetConfig(data []byte, cfg *base.NomadConfig) error { +func (r *RawExecDriver) SetConfig(data []byte, cfg *base.ClientAgentConfig) error { var config Config if err := base.MsgPackDecode(data, &config); err != nil { return err diff --git a/drivers/rawexec/driver_test.go b/drivers/rawexec/driver_test.go index 35c095899..8799ea891 100644 --- a/drivers/rawexec/driver_test.go +++ b/drivers/rawexec/driver_test.go @@ -43,20 +43,20 @@ func TestRawExecDriver_SetConfig(t *testing.T) { var data []byte require.NoError(basePlug.MsgPackEncode(&data, config)) - require.NoError(harness.SetConfig(data)) + require.NoError(harness.SetConfig(data, nil)) require.Exactly(config, d.(*RawExecDriver).config) config.Enabled = true config.NoCgroups = true data = []byte{} require.NoError(basePlug.MsgPackEncode(&data, config)) - require.NoError(harness.SetConfig(data)) + require.NoError(harness.SetConfig(data, nil)) require.Exactly(config, d.(*RawExecDriver).config) config.NoCgroups = false data = []byte{} require.NoError(basePlug.MsgPackEncode(&data, config)) - require.NoError(harness.SetConfig(data)) + require.NoError(harness.SetConfig(data, nil)) require.Exactly(config, d.(*RawExecDriver).config) } @@ -72,7 +72,7 @@ func TestRawExecDriver_Fingerprint(t *testing.T) { var data []byte require.NoError(basePlug.MsgPackEncode(&data, config)) - require.NoError(harness.SetConfig(data)) + require.NoError(harness.SetConfig(data, nil)) fingerCh, err := harness.Fingerprint(context.Background()) require.NoError(err) @@ -88,7 +88,7 @@ func TestRawExecDriver_Fingerprint(t *testing.T) { config.Enabled = true data = []byte{} require.NoError(basePlug.MsgPackEncode(&data, config)) - require.NoError(harness.SetConfig(data)) + require.NoError(harness.SetConfig(data, nil)) FINGER_LOOP: for { diff --git a/drivers/rkt/driver.go b/drivers/rkt/driver.go index b59ea6ca4..9ba3bdd97 100644 --- a/drivers/rkt/driver.go +++ b/drivers/rkt/driver.go @@ -154,7 +154,7 @@ type RktDriver struct { config *Config // nomadConfig is the client config from nomad - nomadConfig *base.NomadDriverConfig + nomadConfig *base.ClientDriverConfig // tasks is the in memory datastore mapping taskIDs to rktTaskHandles tasks *taskStore @@ -193,7 +193,7 @@ func (d *RktDriver) ConfigSchema() (*hclspec.Spec, error) { return configSpec, nil } -func (d *RktDriver) SetConfig(data []byte, cfg *base.NomadConfig) error { +func (d *RktDriver) SetConfig(data []byte, cfg *base.ClientAgentConfig) error { var config Config if err := base.MsgPackDecode(data, &config); err != nil { return err diff --git a/drivers/rkt/driver_test.go b/drivers/rkt/driver_test.go index f3240d6bd..c9debc65d 100644 --- a/drivers/rkt/driver_test.go +++ b/drivers/rkt/driver_test.go @@ -64,13 +64,13 @@ func TestRktDriver_SetConfig(t *testing.T) { var data []byte require.NoError(basePlug.MsgPackEncode(&data, config)) - require.NoError(harness.SetConfig(data)) + require.NoError(harness.SetConfig(data, nil)) require.Exactly(config, d.(*RktDriver).config) config.VolumesEnabled = false data = []byte{} require.NoError(basePlug.MsgPackEncode(&data, config)) - require.NoError(harness.SetConfig(data)) + require.NoError(harness.SetConfig(data, nil)) require.Exactly(config, d.(*RktDriver).config) } @@ -434,7 +434,7 @@ func TestRktDriver_Start_Wait_Volume(t *testing.T) { var data []byte require.NoError(basePlug.MsgPackEncode(&data, config)) - require.NoError(harness.SetConfig(data)) + require.NoError(harness.SetConfig(data, nil)) task := &drivers.TaskConfig{ ID: uuid.Generate(), diff --git a/plugins/base/base.go b/plugins/base/base.go index e51ae4adc..7a9f7c5f6 100644 --- a/plugins/base/base.go +++ b/plugins/base/base.go @@ -15,7 +15,7 @@ type BasePlugin interface { // SetConfig is used to set the configuration by passing a MessagePack // encoding of it. - SetConfig(data []byte, config *NomadConfig) error + SetConfig(data []byte, config *ClientAgentConfig) error } // PluginInfoResponse returns basic information about the plugin such that Nomad @@ -35,13 +35,13 @@ type PluginInfoResponse struct { Name string } -// NomadConfig is the nomad client configuration sent to all plugins -type NomadConfig struct { - Driver *NomadDriverConfig +// ClientAgentConfig is the nomad client configuration sent to all plugins +type ClientAgentConfig struct { + Driver *ClientDriverConfig } -// NomadDriverConfig is the driver specific configuration for all driver plugins -type NomadDriverConfig struct { +// ClientDriverConfig is the driver specific configuration for all driver plugins +type ClientDriverConfig struct { // ClientMaxPort is the upper range of the ports that the client uses for // communicating with plugin subsystems over loopback ClientMaxPort uint @@ -51,7 +51,7 @@ type NomadDriverConfig struct { ClientMinPort uint } -func (c *NomadConfig) toProto() *proto.NomadConfig { +func (c *ClientAgentConfig) toProto() *proto.NomadConfig { if c == nil { return nil } @@ -68,14 +68,14 @@ func (c *NomadConfig) toProto() *proto.NomadConfig { return cfg } -func nomadConfigFromProto(pb *proto.NomadConfig) *NomadConfig { +func nomadConfigFromProto(pb *proto.NomadConfig) *ClientAgentConfig { if pb == nil { return nil } - cfg := &NomadConfig{} + cfg := &ClientAgentConfig{} if pb.Driver != nil { - cfg.Driver = &NomadDriverConfig{ + cfg.Driver = &ClientDriverConfig{ ClientMaxPort: uint(pb.Driver.ClientMaxPort), ClientMinPort: uint(pb.Driver.ClientMinPort), } diff --git a/plugins/base/client.go b/plugins/base/client.go index 564bde762..f5476cef7 100644 --- a/plugins/base/client.go +++ b/plugins/base/client.go @@ -49,7 +49,7 @@ func (b *BasePluginClient) ConfigSchema() (*hclspec.Spec, error) { return presp.GetSpec(), nil } -func (b *BasePluginClient) SetConfig(data []byte, config *NomadConfig) error { +func (b *BasePluginClient) SetConfig(data []byte, config *ClientAgentConfig) error { // Send the config _, err := b.Client.SetConfig(context.Background(), &proto.SetConfigRequest{ MsgpackConfig: data, diff --git a/plugins/base/plugin_test.go b/plugins/base/plugin_test.go index f45b16f3f..b64ba0edf 100644 --- a/plugins/base/plugin_test.go +++ b/plugins/base/plugin_test.go @@ -118,7 +118,7 @@ func TestBasePlugin_SetConfig(t *testing.T) { ConfigSchemaF: func() (*hclspec.Spec, error) { return TestSpec, nil }, - SetConfigF: func(data []byte, cfg *NomadConfig) error { + SetConfigF: func(data []byte, cfg *ClientAgentConfig) error { receivedData = data return nil }, @@ -147,7 +147,7 @@ func TestBasePlugin_SetConfig(t *testing.T) { }) cdata, err := msgpack.Marshal(config, config.Type()) require.NoError(err) - require.NoError(impl.SetConfig(cdata, &NomadConfig{})) + require.NoError(impl.SetConfig(cdata, &ClientAgentConfig{})) require.Equal(cdata, receivedData) // Decode the value back diff --git a/plugins/base/server.go b/plugins/base/server.go index be20a38cc..e9afd2641 100644 --- a/plugins/base/server.go +++ b/plugins/base/server.go @@ -62,7 +62,7 @@ func (b *basePluginServer) SetConfig(ctx context.Context, req *proto.SetConfigRe // Client configuration is filtered based on plugin type cfg := nomadConfigFromProto(req.GetNomadConfig()) - filteredCfg := new(NomadConfig) + filteredCfg := new(ClientAgentConfig) switch info.Type { case PluginTypeDriver: diff --git a/plugins/base/testing.go b/plugins/base/testing.go index 3171850e3..09cf7c1a3 100644 --- a/plugins/base/testing.go +++ b/plugins/base/testing.go @@ -52,9 +52,11 @@ type TestConfig struct { type MockPlugin struct { PluginInfoF func() (*PluginInfoResponse, error) ConfigSchemaF func() (*hclspec.Spec, error) - SetConfigF func([]byte, *NomadConfig) error + SetConfigF func([]byte, *ClientAgentConfig) error } -func (p *MockPlugin) PluginInfo() (*PluginInfoResponse, error) { return p.PluginInfoF() } -func (p *MockPlugin) ConfigSchema() (*hclspec.Spec, error) { return p.ConfigSchemaF() } -func (p *MockPlugin) SetConfig(data []byte, cfg *NomadConfig) error { return p.SetConfigF(data, cfg) } +func (p *MockPlugin) PluginInfo() (*PluginInfoResponse, error) { return p.PluginInfoF() } +func (p *MockPlugin) ConfigSchema() (*hclspec.Spec, error) { return p.ConfigSchemaF() } +func (p *MockPlugin) SetConfig(data []byte, cfg *ClientAgentConfig) error { + return p.SetConfigF(data, cfg) +} diff --git a/plugins/device/cmd/example/device.go b/plugins/device/cmd/example/device.go index 3c574db3d..f486d72cf 100644 --- a/plugins/device/cmd/example/device.go +++ b/plugins/device/cmd/example/device.go @@ -116,7 +116,7 @@ func (d *FsDevice) ConfigSchema() (*hclspec.Spec, error) { } // SetConfig is used to set the configuration of the plugin. -func (d *FsDevice) SetConfig(data []byte, cfg *base.NomadConfig) error { +func (d *FsDevice) SetConfig(data []byte, cfg *base.ClientAgentConfig) error { var config Config if err := base.MsgPackDecode(data, &config); err != nil { return err diff --git a/plugins/device/plugin_test.go b/plugins/device/plugin_test.go index 6779e50f7..ab410ce24 100644 --- a/plugins/device/plugin_test.go +++ b/plugins/device/plugin_test.go @@ -131,7 +131,7 @@ func TestDevicePlugin_SetConfig(t *testing.T) { ConfigSchemaF: func() (*hclspec.Spec, error) { return base.TestSpec, nil }, - SetConfigF: func(data []byte) error { + SetConfigF: func(data []byte, cfg *base.ClientAgentConfig) error { receivedData = data return nil }, @@ -162,7 +162,7 @@ func TestDevicePlugin_SetConfig(t *testing.T) { }) cdata, err := msgpack.Marshal(config, config.Type()) require.NoError(err) - require.NoError(impl.SetConfig(cdata)) + require.NoError(impl.SetConfig(cdata, nil)) require.Equal(cdata, receivedData) // Decode the value back diff --git a/plugins/drivers/utils/utils.go b/plugins/drivers/utils/utils.go index 563930b32..53addf206 100644 --- a/plugins/drivers/utils/utils.go +++ b/plugins/drivers/utils/utils.go @@ -26,7 +26,7 @@ func CgroupsMounted(node *structs.Node) bool { // CreateExecutor launches an executor plugin and returns an instance of the // Executor interface -func CreateExecutor(w io.Writer, level hclog.Level, nomadConfig *base.NomadDriverConfig, +func CreateExecutor(w io.Writer, level hclog.Level, nomadConfig *base.ClientDriverConfig, executorConfig *dstructs.ExecutorConfig) (executor.Executor, *plugin.Client, error) { c, err := json.Marshal(executorConfig) diff --git a/plugins/shared/cmd/launcher/command/device.go b/plugins/shared/cmd/launcher/command/device.go index 9e58f1c91..fd99582fc 100644 --- a/plugins/shared/cmd/launcher/command/device.go +++ b/plugins/shared/cmd/launcher/command/device.go @@ -52,7 +52,7 @@ General Options: ` + generalOptionsUsage() + ` Device Options: - + -trace Enable trace level log output. ` @@ -119,7 +119,7 @@ func (c *Device) Run(args []string) int { } c.spec = spec - if err := c.setConfig(spec, config); err != nil { + if err := c.setConfig(spec, config, nil); err != nil { c.logger.Error("failed to set config", "error", err) return 1 } @@ -187,7 +187,7 @@ func (c *Device) getSpec() (hcldec.Spec, error) { return schema, nil } -func (c *Device) setConfig(spec hcldec.Spec, config []byte) error { +func (c *Device) setConfig(spec hcldec.Spec, config []byte, nmdCfg *base.ClientAgentConfig) error { // Parse the config into hcl configVal, err := hclConfigToInterface(config) if err != nil { @@ -216,7 +216,7 @@ func (c *Device) setConfig(spec hcldec.Spec, config []byte) error { } c.logger.Trace("msgpack config", "config", string(cdata)) - if err := c.dev.SetConfig(cdata); err != nil { + if err := c.dev.SetConfig(cdata, nmdCfg); err != nil { return err } diff --git a/plugins/shared/loader/loader.go b/plugins/shared/loader/loader.go index 689b1ce26..f15d353f2 100644 --- a/plugins/shared/loader/loader.go +++ b/plugins/shared/loader/loader.go @@ -18,7 +18,7 @@ import ( type PluginCatalog interface { // Dispense returns the plugin given its name and type. This will also // configure the plugin - Dispense(name, pluginType string, config *base.NomadConfig, logger log.Logger) (PluginInstance, error) + Dispense(name, pluginType string, config *base.ClientAgentConfig, logger log.Logger) (PluginInstance, error) // Reattach is used to reattach to a previously launched external plugin. Reattach(name, pluginType string, config *plugin.ReattachConfig) (PluginInstance, error) @@ -114,7 +114,7 @@ func NewPluginLoader(config *PluginLoaderConfig) (*PluginLoader, error) { // Dispense returns a plugin instance, loading it either internally or by // launching an external plugin. -func (l *PluginLoader) Dispense(name, pluginType string, config *base.NomadConfig, logger log.Logger) (PluginInstance, error) { +func (l *PluginLoader) Dispense(name, pluginType string, config *base.ClientAgentConfig, logger log.Logger) (PluginInstance, error) { id := PluginID{ Name: name, PluginType: pluginType, diff --git a/plugins/shared/loader/loader_test.go b/plugins/shared/loader/loader_test.go index 61c4be12a..71363ad45 100644 --- a/plugins/shared/loader/loader_test.go +++ b/plugins/shared/loader/loader_test.go @@ -698,8 +698,8 @@ func TestPluginLoader_Dispense_Internal(t *testing.T) { defer h.cleanup() expKey := "set_config_worked" - expNomadConfig := &base.NomadConfig{ - Driver: &base.NomadDriverConfig{ + expNomadConfig := &base.ClientAgentConfig{ + Driver: &base.ClientDriverConfig{ ClientMinPort: 100, }, } diff --git a/plugins/shared/loader/plugin_test.go b/plugins/shared/loader/plugin_test.go index fc988b60f..9c16c22f2 100644 --- a/plugins/shared/loader/plugin_test.go +++ b/plugins/shared/loader/plugin_test.go @@ -100,7 +100,7 @@ type mockPlugin struct { // config is built on SetConfig config *mockPluginConfig // nomadconfig is set on SetConfig - nomadConfig *base.NomadConfig + nomadConfig *base.ClientAgentConfig } // mockPluginConfig is the configuration for the mock plugin @@ -140,7 +140,7 @@ func (m *mockPlugin) ConfigSchema() (*hclspec.Spec, error) { } // SetConfig decodes the configuration and stores it -func (m *mockPlugin) SetConfig(data []byte, cfg *base.NomadConfig) error { +func (m *mockPlugin) SetConfig(data []byte, cfg *base.ClientAgentConfig) error { var config mockPluginConfig if err := base.MsgPackDecode(data, &config); err != nil { return err diff --git a/plugins/shared/loader/testing.go b/plugins/shared/loader/testing.go index 3d6c746ae..59041b4a3 100644 --- a/plugins/shared/loader/testing.go +++ b/plugins/shared/loader/testing.go @@ -8,12 +8,12 @@ import ( // MockCatalog provides a mock PluginCatalog to be used for testing type MockCatalog struct { - DispenseF func(name, pluginType string, cfg *base.NomadConfig, logger log.Logger) (PluginInstance, error) + DispenseF func(name, pluginType string, cfg *base.ClientAgentConfig, logger log.Logger) (PluginInstance, error) ReattachF func(name, pluginType string, config *plugin.ReattachConfig) (PluginInstance, error) CatalogF func() map[string][]*base.PluginInfoResponse } -func (m *MockCatalog) Dispense(name, pluginType string, cfg *base.NomadConfig, logger log.Logger) (PluginInstance, error) { +func (m *MockCatalog) Dispense(name, pluginType string, cfg *base.ClientAgentConfig, logger log.Logger) (PluginInstance, error) { return m.DispenseF(name, pluginType, cfg, logger) } diff --git a/plugins/shared/singleton/singleton.go b/plugins/shared/singleton/singleton.go index 0a74572b2..baf7f6244 100644 --- a/plugins/shared/singleton/singleton.go +++ b/plugins/shared/singleton/singleton.go @@ -43,7 +43,7 @@ func (s *SingletonLoader) Catalog() map[string][]*base.PluginInfoResponse { // Dispense returns the plugin given its name and type. This will also // configure the plugin. If there is an instance of an already running plugin, // this is used. -func (s *SingletonLoader) Dispense(name, pluginType string, config *base.NomadConfig, logger log.Logger) (loader.PluginInstance, error) { +func (s *SingletonLoader) Dispense(name, pluginType string, config *base.ClientAgentConfig, logger log.Logger) (loader.PluginInstance, error) { return s.getPlugin(false, name, pluginType, logger, config, nil) } @@ -55,7 +55,7 @@ func (s *SingletonLoader) Reattach(name, pluginType string, config *plugin.Reatt // getPlugin is a helper that either dispenses or reattaches to a plugin using // futures to ensure only a single instance is retrieved func (s *SingletonLoader) getPlugin(reattach bool, name, pluginType string, logger log.Logger, - nomadConfig *base.NomadConfig, config *plugin.ReattachConfig) (loader.PluginInstance, error) { + nomadConfig *base.ClientAgentConfig, config *plugin.ReattachConfig) (loader.PluginInstance, error) { // Lock the instance map to prevent races s.instanceLock.Lock() @@ -95,7 +95,7 @@ func (s *SingletonLoader) getPlugin(reattach bool, name, pluginType string, logg // dispense should be called in a go routine to not block and creates the // desired plugin, setting the results in the future. -func (s *SingletonLoader) dispense(f *future, name, pluginType string, config *base.NomadConfig, logger log.Logger) { +func (s *SingletonLoader) dispense(f *future, name, pluginType string, config *base.ClientAgentConfig, logger log.Logger) { i, err := s.loader.Dispense(name, pluginType, config, logger) f.set(i, err) } diff --git a/plugins/shared/singleton/singleton_test.go b/plugins/shared/singleton/singleton_test.go index 5d5c23d43..3151f8a84 100644 --- a/plugins/shared/singleton/singleton_test.go +++ b/plugins/shared/singleton/singleton_test.go @@ -27,7 +27,7 @@ func TestSingleton_Dispense(t *testing.T) { dispenseCalled := 0 s, c := harness(t) - c.DispenseF = func(_, _ string, _ *base.NomadConfig, _ log.Logger) (loader.PluginInstance, error) { + c.DispenseF = func(_, _ string, _ *base.ClientAgentConfig, _ log.Logger) (loader.PluginInstance, error) { p := &base.MockPlugin{} i := &loader.MockInstance{ ExitedF: func() bool { return false }, @@ -77,7 +77,7 @@ func TestSingleton_Dispense_Exit_Dispense(t *testing.T) { exited := false dispenseCalled := 0 s, c := harness(t) - c.DispenseF = func(_, _ string, _ *base.NomadConfig, _ log.Logger) (loader.PluginInstance, error) { + c.DispenseF = func(_, _ string, _ *base.ClientAgentConfig, _ log.Logger) (loader.PluginInstance, error) { p := &base.MockPlugin{} i := &loader.MockInstance{ ExitedF: func() bool { return exited }, @@ -125,7 +125,7 @@ func TestSingleton_DispenseError_Dispense(t *testing.T) { require := require.New(t) dispenseCalled := 0 - good := func(_, _ string, _ *base.NomadConfig, _ log.Logger) (loader.PluginInstance, error) { + good := func(_, _ string, _ *base.ClientAgentConfig, _ log.Logger) (loader.PluginInstance, error) { p := &base.MockPlugin{} i := &loader.MockInstance{ ExitedF: func() bool { return false }, @@ -135,7 +135,7 @@ func TestSingleton_DispenseError_Dispense(t *testing.T) { return i, nil } - bad := func(_, _ string, _ *base.NomadConfig, _ log.Logger) (loader.PluginInstance, error) { + bad := func(_, _ string, _ *base.ClientAgentConfig, _ log.Logger) (loader.PluginInstance, error) { dispenseCalled++ return nil, fmt.Errorf("bad") } @@ -169,7 +169,7 @@ func TestSingleton_ReattachError_Dispense(t *testing.T) { dispenseCalled, reattachCalled := 0, 0 s, c := harness(t) - c.DispenseF = func(_, _ string, _ *base.NomadConfig, _ log.Logger) (loader.PluginInstance, error) { + c.DispenseF = func(_, _ string, _ *base.ClientAgentConfig, _ log.Logger) (loader.PluginInstance, error) { p := &base.MockPlugin{} i := &loader.MockInstance{ ExitedF: func() bool { return false }, @@ -209,7 +209,7 @@ func TestSingleton_Reattach_Dispense(t *testing.T) { dispenseCalled, reattachCalled := 0, 0 s, c := harness(t) - c.DispenseF = func(_, _ string, _ *base.NomadConfig, _ log.Logger) (loader.PluginInstance, error) { + c.DispenseF = func(_, _ string, _ *base.ClientAgentConfig, _ log.Logger) (loader.PluginInstance, error) { dispenseCalled++ return nil, fmt.Errorf("bad") }