mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
agent: fix panic when logging about protocol version config use. (#12962)
The log line comes before the agent logger has been setup, therefore we need to use the UI logging to avoid panic.
This commit is contained in:
3
.changelog/12962.txt
Normal file
3
.changelog/12962.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
agent: fixed a panic on startup when the `server.protocol_version` config parameter was set
|
||||
```
|
||||
@@ -436,7 +436,7 @@ func (c *Command) IsValidConfig(config, cmdConfig *Config) bool {
|
||||
// ProtocolVersion has never been used. Warn if it is set as someone
|
||||
// has probably made a mistake.
|
||||
if config.Server.ProtocolVersion != 0 {
|
||||
c.agent.logger.Warn("Please remove deprecated protocol_version field from config.")
|
||||
c.Ui.Warn("Please remove deprecated protocol_version field from config.")
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user