lint
This commit is contained in:
parent
4c57d2ec4d
commit
730a6f5b9a
|
@ -565,7 +565,7 @@ func TestFingerprintManager_Run_DriverFailure(t *testing.T) {
|
||||||
|
|
||||||
dispenseCalls := 0
|
dispenseCalls := 0
|
||||||
loader := &loader.MockCatalog{
|
loader := &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) {
|
||||||
if pluginType == base.PluginTypeDriver && name == "raw_exec" {
|
if pluginType == base.PluginTypeDriver && name == "raw_exec" {
|
||||||
dispenseCalls++
|
dispenseCalls++
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ var (
|
||||||
// pluginInfo describes the plugin
|
// pluginInfo describes the plugin
|
||||||
pluginInfo = &base.PluginInfoResponse{
|
pluginInfo = &base.PluginInfoResponse{
|
||||||
Type: base.PluginTypeDevice,
|
Type: base.PluginTypeDevice,
|
||||||
PluginApiVersions: []string{"v0.2.0"},
|
PluginApiVersions: []string{device.ApiVersion010},
|
||||||
PluginVersion: "0.1.0",
|
PluginVersion: "0.1.0",
|
||||||
Name: pluginName,
|
Name: pluginName,
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,13 +64,15 @@ func TestRktDriver_SetConfig(t *testing.T) {
|
||||||
|
|
||||||
var data []byte
|
var data []byte
|
||||||
require.NoError(basePlug.MsgPackEncode(&data, config))
|
require.NoError(basePlug.MsgPackEncode(&data, config))
|
||||||
require.NoError(harness.SetConfig(data, nil))
|
bconfig := &basePlug.Config{PluginConfig: data}
|
||||||
|
require.NoError(harness.SetConfig(bconfig))
|
||||||
require.Exactly(config, d.(*Driver).config)
|
require.Exactly(config, d.(*Driver).config)
|
||||||
|
|
||||||
config.VolumesEnabled = false
|
config.VolumesEnabled = false
|
||||||
data = []byte{}
|
data = []byte{}
|
||||||
require.NoError(basePlug.MsgPackEncode(&data, config))
|
require.NoError(basePlug.MsgPackEncode(&data, config))
|
||||||
require.NoError(harness.SetConfig(data, nil))
|
bconfig = &basePlug.Config{PluginConfig: data}
|
||||||
|
require.NoError(harness.SetConfig(bconfig))
|
||||||
require.Exactly(config, d.(*Driver).config)
|
require.Exactly(config, d.(*Driver).config)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -446,7 +448,8 @@ func TestRktDriver_Start_Wait_Volume(t *testing.T) {
|
||||||
|
|
||||||
var data []byte
|
var data []byte
|
||||||
require.NoError(basePlug.MsgPackEncode(&data, config))
|
require.NoError(basePlug.MsgPackEncode(&data, config))
|
||||||
require.NoError(harness.SetConfig(data, nil))
|
bconfig := &basePlug.Config{PluginConfig: data}
|
||||||
|
require.NoError(harness.SetConfig(bconfig))
|
||||||
|
|
||||||
task := &drivers.TaskConfig{
|
task := &drivers.TaskConfig{
|
||||||
ID: uuid.Generate(),
|
ID: uuid.Generate(),
|
||||||
|
@ -530,7 +533,8 @@ func TestRktDriver_Start_Wait_TaskMounts(t *testing.T) {
|
||||||
|
|
||||||
var data []byte
|
var data []byte
|
||||||
require.NoError(basePlug.MsgPackEncode(&data, config))
|
require.NoError(basePlug.MsgPackEncode(&data, config))
|
||||||
require.NoError(harness.SetConfig(data, nil))
|
bconfig := &basePlug.Config{PluginConfig: data}
|
||||||
|
require.NoError(harness.SetConfig(bconfig))
|
||||||
|
|
||||||
tmpvol, err := ioutil.TempDir("", "nomadtest_rktdriver_volumes")
|
tmpvol, err := ioutil.TempDir("", "nomadtest_rktdriver_volumes")
|
||||||
require.NoError(err)
|
require.NoError(err)
|
||||||
|
|
|
@ -9,7 +9,7 @@ var (
|
||||||
// AgentSupportedApiVersions is the set of API versions supported by the
|
// AgentSupportedApiVersions is the set of API versions supported by the
|
||||||
// Nomad agent by plugin type.
|
// Nomad agent by plugin type.
|
||||||
AgentSupportedApiVersions = map[string][]string{
|
AgentSupportedApiVersions = map[string][]string{
|
||||||
base.PluginTypeDevice: []string{device.ApiVersion010},
|
base.PluginTypeDevice: {device.ApiVersion010},
|
||||||
base.PluginTypeDriver: []string{device.ApiVersion010},
|
base.PluginTypeDriver: {device.ApiVersion010},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -22,7 +22,7 @@ var (
|
||||||
// supportedApiVersions is the set of api versions that the "client" can
|
// supportedApiVersions is the set of api versions that the "client" can
|
||||||
// support
|
// support
|
||||||
supportedApiVersions = map[string][]string{
|
supportedApiVersions = map[string][]string{
|
||||||
base.PluginTypeDevice: []string{device.ApiVersion010},
|
base.PluginTypeDevice: {device.ApiVersion010},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ func TestPluginLoader_External_ApiVersions(t *testing.T) {
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
PluginDir: h.pluginDir(),
|
PluginDir: h.pluginDir(),
|
||||||
SupportedVersions: map[string][]string{
|
SupportedVersions: map[string][]string{
|
||||||
base.PluginTypeDevice: []string{"0.2.0", "0.2.1", "0.3.0"},
|
base.PluginTypeDevice: {"0.2.0", "0.2.1", "0.3.0"},
|
||||||
},
|
},
|
||||||
Configs: []*config.PluginConfig{
|
Configs: []*config.PluginConfig{
|
||||||
{
|
{
|
||||||
|
@ -527,7 +527,7 @@ func TestPluginLoader_Internal_ApiVersions(t *testing.T) {
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
PluginDir: h.pluginDir(),
|
PluginDir: h.pluginDir(),
|
||||||
SupportedVersions: map[string][]string{
|
SupportedVersions: map[string][]string{
|
||||||
base.PluginTypeDevice: []string{"0.2.0", "0.2.1", "0.3.0"},
|
base.PluginTypeDevice: {"0.2.0", "0.2.1", "0.3.0"},
|
||||||
},
|
},
|
||||||
InternalPlugins: map[PluginID]*InternalPluginConfig{
|
InternalPlugins: map[PluginID]*InternalPluginConfig{
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue