Browse Source

Merge pull request #2287 from hashicorp/f-version-tweaks

Makes protocol version a little clearer.
pull/2288/head
James Phillips 8 years ago committed by GitHub
parent
commit
5e0ad0c838
  1. 13
      command/version.go
  2. 6
      website/source/docs/upgrading.html.markdown

13
command/version.go

@ -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
}

6
website/source/docs/upgrading.html.markdown

@ -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…
Cancel
Save