Backport of Fixes Secondary ConnectCA update into release/1.16.x (#17954)

* backport of commit afa1f42cc719b13074f2f286202d8f21b8000753

* backport of commit e0970025d4c2e2702af30e642b37dd5e32561756

* backport of commit 2f2aad545b1ebcae22bb481b57115a679eb539e5

* backport of commit 4a5c9c181f50343911cd30fbb0f0475e473a2c7b

---------

Co-authored-by: Ranjandas <thejranjan@gmail.com>
Co-authored-by: Chris S. Kim <kisunji92@gmail.com>
This commit is contained in:
hc-github-team-consul-core 2023-06-29 09:43:21 -05:00 committed by GitHub
parent 4cad4922a0
commit 2c25a7ecad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

3
.changelog/17846.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
connect/ca: Fixes a bug preventing CA configuration updates in secondary datacenters
```

View File

@ -735,7 +735,9 @@ func shouldPersistNewRootAndConfig(newActiveRoot *structs.CARoot, oldConfig, new
if newConfig == nil {
return false
}
return newConfig.Provider == oldConfig.Provider && reflect.DeepEqual(newConfig.Config, oldConfig.Config)
// Do not persist if the new provider and config are the same as the old
return !(newConfig.Provider == oldConfig.Provider && reflect.DeepEqual(newConfig.Config, oldConfig.Config))
}
func (c *CAManager) UpdateConfiguration(args *structs.CARequest) (reterr error) {