Skip to content

Commit

Permalink
update config parse test
Browse files Browse the repository at this point in the history
documentation fixes
  • Loading branch information
chelseakomlo committed May 25, 2018
1 parent 0a218b4 commit 5e381ce
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
9 changes: 4 additions & 5 deletions command/agent/config-test-fixtures/basic.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ client {
}
server_join {
retry_join = [ "1.1.1.1", "2.2.2.2" ]
retry_max = 3
retry_interval = "15s"
retry_max = 3
retry_interval = "15s"
}

options {
Expand Down Expand Up @@ -95,9 +95,8 @@ server {
encrypt = "abc"
server_join {
retry_join = [ "1.1.1.1", "2.2.2.2" ]
start_join = [ "1.1.1.1", "2.2.2.2" ]
retry_max = 3
retry_interval = "15s"
retry_max = 3
retry_interval = "15s"
}
}
acl {
Expand Down
3 changes: 2 additions & 1 deletion command/agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ type ServerJoin struct {
// addresses, then the agent will error and exit.
StartJoin []string `mapstructure:"start_join"`

// RetryJoin is a list of addresses to join with retry enabled.
// RetryJoin is a list of addresses to join with retry enabled, or a single
// value to find multiple servers using go-discover syntax.
RetryJoin []string `mapstructure:"retry_join"`

// RetryMaxAttempts specifies the maximum number of times to retry joining a
Expand Down
1 change: 0 additions & 1 deletion command/agent/config_parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func TestConfig_Parse(t *testing.T) {
EncryptKey: "abc",
ServerJoin: &ServerJoin{
RetryJoin: []string{"1.1.1.1", "2.2.2.2"},
StartJoin: []string{"1.1.1.1", "2.2.2.2"},
RetryInterval: time.Duration(15) * time.Second,
RetryMaxAttempts: 3,
},
Expand Down
2 changes: 1 addition & 1 deletion command/agent/retry_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (r *retryJoiner) Validate(config *Config) error {
return fmt.Errorf("server_join and retry_max cannot both be defined; try defining only server_join")
}
if config.Server.RetryInterval != "0" {
return fmt.Errorf("server_join and retry_interval cannot both be defined; try defining only server_join")
return fmt.Errorf("server_join and retry_interval cannot both be defined; prefer setting the server_join parameter")
}
}

Expand Down
5 changes: 4 additions & 1 deletion website/source/docs/agent/configuration/client.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ client {
the port. If the port is omitted, the default port of `4647` is used.

- `server_join` <code>([server_join](#server-join): nil)</code> - Specifies
configuration which is specific to retry joining Nomad servers.
how the Nomad client will connect to Nomad servers. The `start_join` field
is not supported on the client. The retry_join fields may directly specify
the server address or use go-discover syntax for auto-discovery. See the
documentation for more detail.

- `state_dir` `(string: "[data_dir]/client")` - Specifies the directory to use
to store client state. By default, this is - the top-level
Expand Down
4 changes: 3 additions & 1 deletion website/source/docs/agent/configuration/server.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ server {
rejoin the cluster.

- `server_join` <code>([server_join](#server-join): nil)</code> - Specifies
configuration for retry joining Nomad servers if the first attempt fails.
how the Nomad client will connect to Nomad servers. The retry_join fields may
directly specify the server address or use go-discover syntax for
auto-discovery. See the documentation for more detail.

- `upgrade_version` `(string: "")` - A custom version of the format X.Y.Z to use
in place of the Nomad version when custom upgrades are enabled in Autopilot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ nomad-01.company.local => nomad-01.company.local:4648

#### Via the go-discover interface

As of Nomad 0.8.4, `retry-join` accepts a unified interface using the
As of Nomad 0.8.4, `retry_join` accepts a unified interface using the
[go-discover](https://github.com/hashicorp/go-discover) library for doing
automated cluster joining using cloud metadata.

Expand Down

0 comments on commit 5e381ce

Please sign in to comment.