From 740344bc05ccd286e4a034bd5b880641807e14be Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Fri, 28 Apr 2023 13:06:11 -0400 Subject: [PATCH] backport of commit d51ae039b2c53e2c960b4d8f4fd5cd30f84f7f4d (#20423) Co-authored-by: Josh Black --- sdk/helper/consts/consts.go | 4 ++++ vault/core.go | 8 -------- vault/testing.go | 8 ++++++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sdk/helper/consts/consts.go b/sdk/helper/consts/consts.go index a4b7c5040422..b820600786b8 100644 --- a/sdk/helper/consts/consts.go +++ b/sdk/helper/consts/consts.go @@ -36,4 +36,8 @@ const ( VaultEnableFilePermissionsCheckEnv = "VAULT_ENABLE_FILE_PERMISSIONS_CHECK" VaultDisableUserLockout = "VAULT_DISABLE_USER_LOCKOUT" + + PerformanceReplicationPathTarget = "performance" + + DRReplicationPathParget = "dr" ) diff --git a/vault/core.go b/vault/core.go index a3f54ccd576b..36cd10878109 100644 --- a/vault/core.go +++ b/vault/core.go @@ -514,12 +514,6 @@ type Core struct { // CORS Information corsConfig *CORSConfig - // The active set of upstream cluster addresses; stored via the Echo - // mechanism, loaded by the balancer - atomicPrimaryClusterAddrs *atomic.Value - - atomicPrimaryFailoverAddrs *atomic.Value - // replicationState keeps the current replication state cached for quick // lookup; activeNodeReplicationState stores the active value on standbys replicationState *uint32 @@ -974,8 +968,6 @@ func CreateCore(conf *CoreConfig) (*Core, error) { introspectionEnabled: conf.EnableIntrospection, shutdownDoneCh: new(atomic.Value), replicationState: new(uint32), - atomicPrimaryClusterAddrs: new(atomic.Value), - atomicPrimaryFailoverAddrs: new(atomic.Value), localClusterPrivateKey: new(atomic.Value), localClusterCert: new(atomic.Value), localClusterParsedCert: new(atomic.Value), diff --git a/vault/testing.go b/vault/testing.go index 056526173063..bb8156f8d503 100644 --- a/vault/testing.go +++ b/vault/testing.go @@ -966,6 +966,10 @@ func (c *TestClusterCore) Seal(t testing.T) { } } +func (c *TestClusterCore) LogicalStorage() logical.Storage { + return c.barrier +} + func (c *TestClusterCore) stop() error { c.Logger().Info("stopping vault test core") @@ -1020,6 +1024,10 @@ func (c *TestClusterCore) TLSConfig() *tls.Config { return c.tlsConfig.Clone() } +func (c *TestClusterCore) ClusterListener() *cluster.Listener { + return c.getClusterListener() +} + func (c *TestCluster) Cleanup() { c.Logger.Info("cleaning up vault cluster") if tl, ok := c.Logger.(*corehelpers.TestLogger); ok {