mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Not syncing stdout and stderr of pluging with client
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/go-plugin"
|
||||
@@ -24,9 +25,19 @@ func (e *ExecutorPluginCommand) Synopsis() string {
|
||||
}
|
||||
|
||||
func (e *ExecutorPluginCommand) Run(args []string) int {
|
||||
if len(args) == 0 {
|
||||
e.Ui.Error("log output file isn't provided")
|
||||
return 1
|
||||
}
|
||||
logFileName := args[0]
|
||||
stdo, err := os.OpenFile(logFileName, os.O_CREATE|os.O_RDWR|os.O_APPEND, 0666)
|
||||
if err != nil {
|
||||
e.Ui.Error(err.Error())
|
||||
return 1
|
||||
}
|
||||
plugin.Serve(&plugin.ServeConfig{
|
||||
HandshakeConfig: driver.HandshakeConfig,
|
||||
Plugins: driver.PluginMap,
|
||||
Plugins: driver.GetPluginMap(stdo),
|
||||
})
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user