inline assignment

This commit is contained in:
Daniel Nephin 2021-06-17 15:41:01 -04:00
parent 619468a7c7
commit b0a2252fa0
1 changed files with 2 additions and 8 deletions

View File

@ -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,