Skip to content

Commit

Permalink
command/agent: Lowercase DC. Fixes #761
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed May 5, 2015
1 parent 8b8abe2 commit ea577fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ FEATURES:

* Ability to configure minimum session TTL. [GH-821]

BUG FIXES:

* Datacenter is lowercased, fixes DNS lookups [GH-761]

IMPROVEMENTS:

* Raft uses BoltDB as the backend store. [GH-857]
Expand Down
4 changes: 4 additions & 0 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ func (c *Command) readConfig() *Config {
}
}

// Ensure the datacenter is always lowercased. The DNS endpoints automatically
// lowercase all queries, and internally we expect DC1 and dc1 to be the same.
config.Datacenter = strings.ToLower(config.Datacenter)

// Verify datacenter is valid
if !validDatacenter.MatchString(config.Datacenter) {
c.Ui.Error("Datacenter must be alpha-numeric with underscores and hypens only")
Expand Down

0 comments on commit ea577fb

Please sign in to comment.