mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
Merge pull request #535 from hashicorp/f-warn-unused-config
Warn the user when they specify a config file / folder that doesn't add any configuration options
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -135,6 +136,12 @@ func (c *Command) readConfig() *Config {
|
||||
return nil
|
||||
}
|
||||
|
||||
// The user asked us to load some config here but we didn't find any,
|
||||
// so we'll complain but continue.
|
||||
if current == nil || reflect.DeepEqual(current, &Config{}) {
|
||||
c.Ui.Warn(fmt.Sprintf("No configuration loaded from %s", path))
|
||||
}
|
||||
|
||||
if config == nil {
|
||||
config = current
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user