33 lines
634 B
Go
33 lines
634 B
Go
package command
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/hashicorp/go-plugin"
|
|
|
|
"github.com/hashicorp/nomad/client/driver"
|
|
)
|
|
|
|
type ExecutorPluginCommand struct {
|
|
Meta
|
|
}
|
|
|
|
func (e *ExecutorPluginCommand) Help() string {
|
|
helpText := `
|
|
This is a command used by Nomad internally to launch an executor plugin"
|
|
`
|
|
return strings.TrimSpace(helpText)
|
|
}
|
|
|
|
func (e *ExecutorPluginCommand) Synopsis() string {
|
|
return "internal - launch an executor plugin"
|
|
}
|
|
|
|
func (e *ExecutorPluginCommand) Run(args []string) int {
|
|
plugin.Serve(&plugin.ServeConfig{
|
|
HandshakeConfig: driver.HandshakeConfig,
|
|
Plugins: driver.PluginMap,
|
|
})
|
|
return 0
|
|
}
|