mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 08:55:43 +03:00
Better parsing of raw_exec option and updated docs
This commit is contained in:
@@ -46,8 +46,12 @@ func NewRawExecDriver(ctx *DriverContext) Driver {
|
||||
|
||||
func (d *RawExecDriver) Fingerprint(cfg *config.Config, node *structs.Node) (bool, error) {
|
||||
// Check that the user has explicitly enabled this executor.
|
||||
enabled := strings.ToLower(cfg.ReadDefault(rawExecConfigOption, "false"))
|
||||
if enabled == "1" || enabled == "true" {
|
||||
enabled, err := strconv.ParseBool(cfg.ReadDefault(rawExecConfigOption, "false"))
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("Failed to parse %v option: %v", rawExecConfigOption, err)
|
||||
}
|
||||
|
||||
if enabled {
|
||||
d.logger.Printf("[WARN] driver.raw_exec: raw exec is enabled. Only enable if needed")
|
||||
node.Attributes["driver.raw_exec"] = "1"
|
||||
return true, nil
|
||||
|
||||
@@ -11,8 +11,8 @@ description: |-
|
||||
Name: `raw_exec`
|
||||
|
||||
The `raw_exec` driver is used to execute a command for a task without any
|
||||
resource isolation. As such, it should be used with extreme care and is disabled
|
||||
by default.
|
||||
isolation. Further, the task is started as the same user as the Nomad process.
|
||||
As such, it should be used with extreme care and is disabled by default.
|
||||
|
||||
## Task Configuration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user