From 0cad3c8936dca9fff34abc8293e91590190bada1 Mon Sep 17 00:00:00 2001 From: Ranjandas Date: Thu, 15 Jun 2023 07:54:01 +0000 Subject: [PATCH 1/4] backport of commit afa1f42cc719b13074f2f286202d8f21b8000753 --- agent/consul/leader_connect_ca.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agent/consul/leader_connect_ca.go b/agent/consul/leader_connect_ca.go index abb92f54b6bb..ef5364dcbb9c 100644 --- a/agent/consul/leader_connect_ca.go +++ b/agent/consul/leader_connect_ca.go @@ -754,7 +754,9 @@ func shouldPersistNewRootAndConfig(newActiveRoot *structs.CARoot, oldConfig, new if newConfig == nil { return false } - return newConfig.Provider == oldConfig.Provider && reflect.DeepEqual(newConfig.Config, oldConfig.Config) + + // Need not persist when the provider, old and new config is the same + return !(newConfig.Provider == oldConfig.Provider && reflect.DeepEqual(newConfig.Config, oldConfig.Config)) } func (c *CAManager) UpdateConfiguration(args *structs.CARequest) (reterr error) { From 7fbccd583f6ad7b18ca79d0dd0e7d8cd3d838d22 Mon Sep 17 00:00:00 2001 From: Ranjandas Date: Fri, 23 Jun 2023 00:12:14 +0000 Subject: [PATCH 2/4] backport of commit e0970025d4c2e2702af30e642b37dd5e32561756 --- .changelog/17846.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/17846.txt diff --git a/.changelog/17846.txt b/.changelog/17846.txt new file mode 100644 index 000000000000..da7cd507d5e7 --- /dev/null +++ b/.changelog/17846.txt @@ -0,0 +1,3 @@ +```release-note:bug +connect/ca: Fixes a bug that caused the ConnectCA configuration in secondary DC not persist after initial configuration. +``` From 74eb652439230b6bdea20405fd3e8bb46174077e Mon Sep 17 00:00:00 2001 From: "Chris S. Kim" Date: Tue, 27 Jun 2023 15:12:29 +0000 Subject: [PATCH 3/4] backport of commit 2f2aad545b1ebcae22bb481b57115a679eb539e5 --- agent/consul/leader_connect_ca.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/consul/leader_connect_ca.go b/agent/consul/leader_connect_ca.go index ef5364dcbb9c..39defb752b0a 100644 --- a/agent/consul/leader_connect_ca.go +++ b/agent/consul/leader_connect_ca.go @@ -755,7 +755,7 @@ func shouldPersistNewRootAndConfig(newActiveRoot *structs.CARoot, oldConfig, new return false } - // Need not persist when the provider, old and new config is the same + // 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)) } From 87a7afac4d719111ed7d553d393f5a35d3e2ceba Mon Sep 17 00:00:00 2001 From: "Chris S. Kim" Date: Tue, 27 Jun 2023 15:12:36 +0000 Subject: [PATCH 4/4] backport of commit 4a5c9c181f50343911cd30fbb0f0475e473a2c7b --- .changelog/17846.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/17846.txt b/.changelog/17846.txt index da7cd507d5e7..bd5a052f851f 100644 --- a/.changelog/17846.txt +++ b/.changelog/17846.txt @@ -1,3 +1,3 @@ ```release-note:bug -connect/ca: Fixes a bug that caused the ConnectCA configuration in secondary DC not persist after initial configuration. +connect/ca: Fixes a bug preventing CA configuration updates in secondary datacenters ```