From 2cc446657313bf88f7ee1aaa697645b6944eb1b2 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Tue, 15 Jan 2019 08:25:03 -0500 Subject: [PATCH] propogate logs to executor plugin --- drivers/shared/executor/utils.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/shared/executor/utils.go b/drivers/shared/executor/utils.go index 58c613223..372236c32 100644 --- a/drivers/shared/executor/utils.go +++ b/drivers/shared/executor/utils.go @@ -37,9 +37,14 @@ func CreateExecutor(logger hclog.Logger, driverConfig *base.ClientDriverConfig, return nil, nil, fmt.Errorf("unable to find the nomad binary: %v", err) } + p := &ExecutorPlugin{ + logger: logger, + fsIsolation: executorConfig.FSIsolation, + } + config := &plugin.ClientConfig{ HandshakeConfig: base.Handshake, - Plugins: map[string]plugin.Plugin{"executor": &ExecutorPlugin{}}, + Plugins: map[string]plugin.Plugin{"executor": p}, Cmd: exec.Command(bin, "executor", string(c)), AllowedProtocols: []plugin.Protocol{plugin.ProtocolGRPC}, Logger: logger.Named("executor"), @@ -75,10 +80,14 @@ func CreateExecutor(logger hclog.Logger, driverConfig *base.ClientDriverConfig, // CreateExecutorWithConfig launches a plugin with a given plugin config func CreateExecutorWithConfig(reattachConfig *plugin.ReattachConfig, logger hclog.Logger) (Executor, *plugin.Client, error) { + p := &ExecutorPlugin{ + logger: logger, + } + config := &plugin.ClientConfig{ HandshakeConfig: base.Handshake, Reattach: reattachConfig, - Plugins: map[string]plugin.Plugin{"executor": &ExecutorPlugin{}}, + Plugins: map[string]plugin.Plugin{"executor": p}, // TODO: Use versioned plugin map to support backwards compatibility with // existing pre-0.9 executors