diff --git a/client/consul.go b/client/consul.go index 52cf68845..bb3c93b19 100644 --- a/client/consul.go +++ b/client/consul.go @@ -280,7 +280,7 @@ func (c *ConsulService) registerService(service *structs.Service, task *structs. for _, check := range service.Checks { cr := c.makeCheck(service, check, host, port) if err := c.registerCheck(cr); err != nil { - c.logger.Printf("[ERROR] consul: Error while registerting check %v with consul: %v", check.Name, err) + c.logger.Printf("[ERROR] consul: Error while registering check %v with consul: %v", check.Name, err) mErr.Errors = append(mErr.Errors, err) } diff --git a/client/driver/raw_exec.go b/client/driver/raw_exec.go index 5b1d98269..9491873ba 100644 --- a/client/driver/raw_exec.go +++ b/client/driver/raw_exec.go @@ -3,7 +3,6 @@ package driver import ( "fmt" "path/filepath" - "strconv" "time" "github.com/hashicorp/nomad/client/allocdir" @@ -43,10 +42,7 @@ 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, err := strconv.ParseBool(cfg.ReadDefault(rawExecConfigOption, "false")) - if err != nil { - return false, fmt.Errorf("Failed to parse %v option: %v", rawExecConfigOption, err) - } + enabled := cfg.ReadBoolDefault(rawExecConfigOption, false) if enabled { d.logger.Printf("[WARN] driver.raw_exec: raw exec is enabled. Only enable if needed") diff --git a/command/agent/config.go b/command/agent/config.go index e94ce2e4c..e3fb3ae17 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -257,6 +257,9 @@ func DevConfig() *Config { } else if runtime.GOOS == "linux" { conf.Client.NetworkInterface = "lo" } + conf.Client.Options = map[string]string{ + "driver.raw_exec.enable": "true", + } return conf } diff --git a/command/agent/config_test.go b/command/agent/config_test.go index 917ecf1c0..e342b997b 100644 --- a/command/agent/config_test.go +++ b/command/agent/config_test.go @@ -318,9 +318,10 @@ func TestConfig_LoadConfigsFileOrder(t *testing.T) { } expected := []string{ - "test-resources/etcnomad/common.hcl", - "test-resources/etcnomad/server.json", - "test-resources/myconf", + // filepath.FromSlash changes these to backslash \ on Windows + filepath.FromSlash("test-resources/etcnomad/common.hcl"), + filepath.FromSlash("test-resources/etcnomad/server.json"), + filepath.FromSlash("test-resources/myconf"), } config := config1.Merge(config2)