From 0e9718247da5c4c2b153be066c36c70e22ccbc90 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Tue, 5 May 2015 13:56:37 -0700 Subject: [PATCH] command/agent: Lowercase DC. Fixes #761 --- CHANGELOG.md | 4 ++++ command/agent/command.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 237040c5e..6c9b7ea46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/command/agent/command.go b/command/agent/command.go index 3ee903bd8..c8d3fef75 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -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")