cleanup code comments and small fixes from refactor

This commit is contained in:
Nick Ethier 2019-01-15 17:07:21 -05:00
parent f626b6bf3d
commit 30b9c95427
No known key found for this signature in database
GPG Key ID: 07C1A3ECED90D24A
5 changed files with 14 additions and 9 deletions

View File

@ -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,

View File

@ -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

View File

@ -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",
}

View File

@ -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)
}

View File

@ -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)
}