From b0a2252fa09c0512723fd0c88eda2a63c88f2751 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 17 Jun 2021 15:41:01 -0400 Subject: [PATCH] inline assignment --- agent/config/builder.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/agent/config/builder.go b/agent/config/builder.go index ed34f19a0..a35dc856f 100644 --- a/agent/config/builder.go +++ b/agent/config/builder.go @@ -669,7 +669,6 @@ func (b *builder) Build() (rt RuntimeConfig, err error) { // autoEncrypt and autoConfig implicitly turns on connect which is why // they need to be above other settings that rely on connect. - autoEncryptTLS := boolVal(c.AutoEncrypt.TLS) autoEncryptDNSSAN := []string{} for _, d := range c.AutoEncrypt.DNSSAN { autoEncryptDNSSAN = append(autoEncryptDNSSAN, d) @@ -685,13 +684,8 @@ func (b *builder) Build() (rt RuntimeConfig, err error) { } autoEncryptAllowTLS := boolVal(c.AutoEncrypt.AllowTLS) - - if autoEncryptAllowTLS { - connectEnabled = true - } - autoConfig := b.autoConfigVal(c.AutoConfig) - if autoConfig.Enabled { + if autoEncryptAllowTLS || autoConfig.Enabled { connectEnabled = true } @@ -984,7 +978,7 @@ func (b *builder) Build() (rt RuntimeConfig, err error) { Checks: checks, ClientAddrs: clientAddrs, ConfigEntryBootstrap: configEntries, - AutoEncryptTLS: autoEncryptTLS, + AutoEncryptTLS: boolVal(c.AutoEncrypt.TLS), AutoEncryptDNSSAN: autoEncryptDNSSAN, AutoEncryptIPSAN: autoEncryptIPSAN, AutoEncryptAllowTLS: autoEncryptAllowTLS,