diff --git a/command/agent/agent.go b/command/agent/agent.go index a2f69964fa1f..8ee4a8a8897e 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -733,7 +733,7 @@ func (a *Agent) Reload(newConfig *Config) error { if newConfig.TLSConfig != nil { if !a.config.TLSConfig.IsEmpty() && !newConfig.TLSConfig.IsEmpty() { - a.logger.Println("[INFO] Updating agent's existing TLS configuration \n\n") + a.logger.Println("[INFO] Updating agent's existing TLS configuration") // Handle errors in loading the new certificate files. // This is just a TLS configuration reload, we don't need to refresh // existing network connections @@ -745,9 +745,9 @@ func (a *Agent) Reload(newConfig *Config) error { a.config.TLSConfig = newConfig.TLSConfig if a.config.TLSConfig.IsEmpty() && !newConfig.TLSConfig.IsEmpty() { - a.logger.Println("[INFO] Upgrading from plaintext configuration to TLS \n\n") + a.logger.Println("[INFO] Upgrading from plaintext configuration to TLS") } else if !a.config.TLSConfig.IsEmpty() && newConfig.TLSConfig.IsEmpty() { - a.logger.Println("[WARN] Downgrading agent's existing TLS configuration to plaintext \n\n") + a.logger.Println("[WARN] Downgrading agent's existing TLS configuration to plaintext") } // Reload the TLS configuration for the client or server, depending on how diff --git a/nomad/server_test.go b/nomad/server_test.go index 4382931e2db0..85700f205597 100644 --- a/nomad/server_test.go +++ b/nomad/server_test.go @@ -281,7 +281,7 @@ func TestServer_Reload_Vault(t *testing.T) { } // Tests that the server will successfully reload its network connections, -// upgrading from plaintext to TLS if the server's TLS configuratoin changes. +// upgrading from plaintext to TLS if the server's TLS configuration changes. func TestServer_Reload_TLSConnections(t *testing.T) { t.Parallel() assert := assert.New(t) diff --git a/nomad/structs/config/tls.go b/nomad/structs/config/tls.go index 0337574c1c50..0c647c0ee07f 100644 --- a/nomad/structs/config/tls.go +++ b/nomad/structs/config/tls.go @@ -84,9 +84,7 @@ func (t *TLSConfig) GetKeyLoader() *KeyLoader { // If the keyloader has not yet been initialized, do it here if t.KeyLoader == nil { - t.configLock.Lock() t.KeyLoader = &KeyLoader{} - t.configLock.Unlock() } return t.KeyLoader }