Makes protocol version a little clearer.
This commit is contained in:
parent
db4666c7e4
commit
5f5e0b3e76
|
@ -2,6 +2,7 @@ package command
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/command/agent"
|
||||
"github.com/hashicorp/consul/consul"
|
||||
"github.com/mitchellh/cli"
|
||||
)
|
||||
|
@ -18,8 +19,16 @@ func (c *VersionCommand) Help() string {
|
|||
|
||||
func (c *VersionCommand) Run(_ []string) int {
|
||||
c.Ui.Output(fmt.Sprintf("Consul Version: %s", c.HumanVersion))
|
||||
c.Ui.Output(fmt.Sprintf("Supported Protocol Version(s): %d to %d",
|
||||
consul.ProtocolVersionMin, consul.ProtocolVersionMax))
|
||||
|
||||
config := agent.DefaultConfig()
|
||||
var supplement string
|
||||
if config.Protocol < consul.ProtocolVersionMax {
|
||||
supplement = fmt.Sprintf(" (agent will automatically use protocol >%d when speaking to compatible agents)",
|
||||
config.Protocol)
|
||||
}
|
||||
c.Ui.Output(fmt.Sprintf("Protocol Version: speaks %d by default, understands %d to %d%s",
|
||||
config.Protocol, consul.ProtocolVersionMin, consul.ProtocolVersionMax, supplement))
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
|
@ -73,12 +73,12 @@ running `consul -v`. You'll see output similar to that below:
|
|||
|
||||
```
|
||||
$ consul -v
|
||||
Consul v0.7.0
|
||||
Supported Protocol Version(s): 2 to 3
|
||||
Consul Version: v0.7.0
|
||||
Protocol Version: speaks 2 by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
|
||||
```
|
||||
|
||||
This says the version of Consul as well as the protocol versions this
|
||||
agent can understand.
|
||||
agent speaks and can understand.
|
||||
|
||||
Note that sometimes Consul will default to speak a lower protocol version
|
||||
than it understands, in order to ease compatibility with older agents. For
|
||||
|
|
Loading…
Reference in New Issue