diff --git a/client/state/08types.go b/client/state/08types.go index 19ac0577d..760539e47 100644 --- a/client/state/08types.go +++ b/client/state/08types.go @@ -86,10 +86,8 @@ func (t *taskRunnerState08) Upgrade(allocID, taskName string) *state.LocalState PrestartDone: t.PayloadRendered, } - //TODO How to convert handles?! This does not work. + // Add nessicary fields to TaskConfig ls.TaskHandle = drivers.NewTaskHandle(0) - - //TODO where do we get this from? ls.TaskHandle.Config = &drivers.TaskConfig{ Name: taskName, AllocID: allocID, diff --git a/drivers/docker/driver.go b/drivers/docker/driver.go index 7c2cd8b1f..85bcb69e6 100644 --- a/drivers/docker/driver.go +++ b/drivers/docker/driver.go @@ -162,7 +162,7 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drive return nil, nil, fmt.Errorf("failed to decode driver config: %v", err) } - handle := drivers.NewTaskHandle(pluginName) + handle := drivers.NewTaskHandle(1) handle.Config = cfg // Initialize docker API clients diff --git a/plugins/base/plugin.go b/plugins/base/plugin.go index 08fa6e753..30d2fd49c 100644 --- a/plugins/base/plugin.go +++ b/plugins/base/plugin.go @@ -25,6 +25,7 @@ const ( var ( // Handshake is a common handshake that is shared by all plugins and Nomad. Handshake = plugin.HandshakeConfig{ + ProtocolVersion: 2, MagicCookieKey: "NOMAD_PLUGIN_MAGIC_COOKIE", MagicCookieValue: "e4327c2e01eabfd75a8a67adb114fb34a757d57eee7728d857a8cec6e91a7255", } diff --git a/plugins/shared/catalog/register.go b/plugins/shared/catalog/register.go index 24e93d94f..bd238e88f 100644 --- a/plugins/shared/catalog/register.go +++ b/plugins/shared/catalog/register.go @@ -1,16 +1,20 @@ package catalog import ( + "github.com/hashicorp/nomad/drivers/docker" "github.com/hashicorp/nomad/drivers/exec" + "github.com/hashicorp/nomad/drivers/java" + "github.com/hashicorp/nomad/drivers/qemu" + "github.com/hashicorp/nomad/drivers/rawexec" ) // This file is where all builtin plugins should be registered in the catalog. // Plugins with build restrictions should be placed in the appropriate // register_XXX.go file. func init() { - // RegisterDeferredConfig(rawexec.PluginID, rawexec.PluginConfig, rawexec.PluginLoader) + RegisterDeferredConfig(rawexec.PluginID, rawexec.PluginConfig, rawexec.PluginLoader) Register(exec.PluginID, exec.PluginConfig) - // Register(qemu.PluginID, qemu.PluginConfig) - // Register(java.PluginID, java.PluginConfig) - // RegisterDeferredConfig(docker.PluginID, docker.PluginConfig, docker.PluginLoader) + Register(qemu.PluginID, qemu.PluginConfig) + Register(java.PluginID, java.PluginConfig) + RegisterDeferredConfig(docker.PluginID, docker.PluginConfig, docker.PluginLoader) } diff --git a/plugins/shared/catalog/register_linux.go b/plugins/shared/catalog/register_linux.go index be3f77e21..91a45b33e 100644 --- a/plugins/shared/catalog/register_linux.go +++ b/plugins/shared/catalog/register_linux.go @@ -1,8 +1,10 @@ package catalog +import "github.com/hashicorp/nomad/drivers/rkt" + // This file is where all builtin plugins should be registered in the catalog. // Plugins with build restrictions should be placed in the appropriate // register_XXX.go file. func init() { - // RegisterDeferredConfig(rkt.PluginID, rkt.PluginConfig, rkt.PluginLoader) + RegisterDeferredConfig(rkt.PluginID, rkt.PluginConfig, rkt.PluginLoader) }