Fixes Secondary ConnectCA update (#17846)

This fixes a bug that was identified which resulted in subsequent
ConnectCA configuration update not to persist in the cluster.
This commit is contained in:
Ranjandas 2023-06-30 00:24:24 +10:00 committed by GitHub
parent bdf4fad7c5
commit 1b1f33f224
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) {