From b1f60121cc974b0ae79149f25efa4c8f0b412046 Mon Sep 17 00:00:00 2001 From: Chelsea Holland Komlo Date: Thu, 5 Jul 2018 17:08:31 -0400 Subject: [PATCH] fix reload issue for tls certificates in dev mode --- command/agent/command.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/command/agent/command.go b/command/agent/command.go index 3a3e041d4..963c5b2be 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -256,6 +256,15 @@ func (c *Command) readConfig() *Config { } } + // Set up the TLS configuration properly if we have one. + // XXX chelseakomlo: set up a TLSConfig New method which would wrap + // constructor-type actions like this. + if config.TLSConfig != nil && !config.TLSConfig.IsEmpty() { + if err := config.TLSConfig.SetChecksum(); err != nil { + c.Ui.Error(fmt.Sprintf("WARNING: Error when parsing TLS configuration: %v", err)) + } + } + if dev { // Skip validation for dev mode return config @@ -319,15 +328,6 @@ func (c *Command) readConfig() *Config { c.Ui.Error("WARNING: Bootstrap mode enabled! Potentially unsafe operation.") } - // Set up the TLS configuration properly if we have one. - // XXX chelseakomlo: set up a TLSConfig New method which would wrap - // constructor-type actions like this. - if config.TLSConfig != nil && !config.TLSConfig.IsEmpty() { - if err := config.TLSConfig.SetChecksum(); err != nil { - c.Ui.Error(fmt.Sprintf("WARNING: Error when parsing TLS configuration: %v", err)) - } - } - return config }