mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Addresses are just addresses - no ports
Store address+port in an unexported field for ease-of-use
This commit is contained in:
@@ -196,7 +196,14 @@ func (c *Command) readConfig() *Config {
|
||||
// Merge any CLI options over config file options
|
||||
config = config.Merge(cmdConfig)
|
||||
|
||||
if ok := config.normalize(c.Ui.Error, dev); !ok {
|
||||
// Set the version info
|
||||
config.Revision = c.Revision
|
||||
config.Version = c.Version
|
||||
config.VersionPrerelease = c.VersionPrerelease
|
||||
|
||||
// Normalize binds, ports, addresses, and advertise
|
||||
if err := config.normalizeAddrs(); err != nil {
|
||||
c.Ui.Error(err.Error())
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -205,6 +212,17 @@ func (c *Command) readConfig() *Config {
|
||||
return config
|
||||
}
|
||||
|
||||
if config.Server.EncryptKey != "" {
|
||||
if _, err := config.Server.EncryptBytes(); err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Invalid encryption key: %s", err))
|
||||
return nil
|
||||
}
|
||||
keyfile := filepath.Join(config.DataDir, serfKeyring)
|
||||
if _, err := os.Stat(keyfile); err == nil {
|
||||
c.Ui.Warn("WARNING: keyring exists but -encrypt given, using keyring")
|
||||
}
|
||||
}
|
||||
|
||||
// Parse the RetryInterval.
|
||||
dur, err := time.ParseDuration(config.Server.RetryInterval)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user