From e3859dc5e544fd29eeaffd1b8bdb77625fc824ab Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Wed, 9 Jan 2019 16:52:06 -0800 Subject: [PATCH] fix rkt use of executor --- drivers/rkt/driver.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/rkt/driver.go b/drivers/rkt/driver.go index 0867135dc..144c21a17 100644 --- a/drivers/rkt/driver.go +++ b/drivers/rkt/driver.go @@ -23,7 +23,6 @@ import ( appcschema "github.com/appc/spec/schema" "github.com/hashicorp/consul-template/signals" hclog "github.com/hashicorp/go-hclog" - plugin "github.com/hashicorp/go-plugin" version "github.com/hashicorp/go-version" "github.com/hashicorp/nomad/client/config" "github.com/hashicorp/nomad/client/taskenv" @@ -366,11 +365,8 @@ func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error { return fmt.Errorf("failed to build ReattachConfig from taskConfig state: %v", err) } - pluginConfig := &plugin.ClientConfig{ - Reattach: plugRC, - } - - execImpl, pluginClient, err := executor.CreateExecutorWithConfig(pluginConfig, os.Stderr) + execImpl, pluginClient, err := executor.CreateExecutorWithConfig(plugRC, + d.logger.With("task_name", handle.Config.Name, "alloc_id", handle.Config.AllocID)) if err != nil { d.logger.Error("failed to reattach to executor", "error", err, "task_id", handle.Config.ID) return fmt.Errorf("failed to reattach to executor: %v", err) @@ -650,7 +646,9 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drive LogLevel: "debug", } - execImpl, pluginClient, err := executor.CreateExecutor(os.Stderr, hclog.Debug, d.nomadConfig, executorConfig) + execImpl, pluginClient, err := executor.CreateExecutor( + d.logger.With("task_name", handle.Config.Name, "alloc_id", handle.Config.AllocID), + d.nomadConfig, executorConfig) if err != nil { return nil, nil, err }