Make -dev-three-node use perf standbys for ent binaries (#20629)

This commit is contained in:
Nick Cabatoff 2023-05-17 14:37:44 -04:00 committed by GitHub
parent 11f9603b37
commit 1a8d3e8948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

3
changelog/20629.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
command/server (enterprise): -dev-three-node now creates perf standbys instead of regular standbys.
```

View File

@ -43,6 +43,7 @@ import (
loghelper "github.com/hashicorp/vault/helper/logging" loghelper "github.com/hashicorp/vault/helper/logging"
"github.com/hashicorp/vault/helper/metricsutil" "github.com/hashicorp/vault/helper/metricsutil"
"github.com/hashicorp/vault/helper/namespace" "github.com/hashicorp/vault/helper/namespace"
"github.com/hashicorp/vault/helper/testhelpers/teststorage"
"github.com/hashicorp/vault/helper/useragent" "github.com/hashicorp/vault/helper/useragent"
vaulthttp "github.com/hashicorp/vault/http" vaulthttp "github.com/hashicorp/vault/http"
"github.com/hashicorp/vault/internalshared/configutil" "github.com/hashicorp/vault/internalshared/configutil"
@ -1999,7 +2000,7 @@ func (c *ServerCommand) enableDev(core *vault.Core, coreConfig *vault.CoreConfig
} }
func (c *ServerCommand) enableThreeNodeDevCluster(base *vault.CoreConfig, info map[string]string, infoKeys []string, devListenAddress, tempDir string) int { func (c *ServerCommand) enableThreeNodeDevCluster(base *vault.CoreConfig, info map[string]string, infoKeys []string, devListenAddress, tempDir string) int {
testCluster := vault.NewTestCluster(&testing.RuntimeT{}, base, &vault.TestClusterOptions{ conf, opts := teststorage.ClusterSetup(base, &vault.TestClusterOptions{
HandlerFunc: vaulthttp.Handler, HandlerFunc: vaulthttp.Handler,
BaseListenAddress: c.flagDevListenAddr, BaseListenAddress: c.flagDevListenAddr,
Logger: c.logger, Logger: c.logger,
@ -2014,9 +2015,18 @@ func (c *ServerCommand) enableThreeNodeDevCluster(base *vault.CoreConfig, info m
}, },
}, },
}, },
}) }, nil)
testCluster := vault.NewTestCluster(&testing.RuntimeT{}, conf, opts)
defer c.cleanupGuard.Do(testCluster.Cleanup) defer c.cleanupGuard.Do(testCluster.Cleanup)
if constants.IsEnterprise {
err := testcluster.WaitForActiveNodeAndPerfStandbys(context.Background(), testCluster)
if err != nil {
c.UI.Error(fmt.Sprintf("perf standbys didn't become ready: %v", err))
return 1
}
}
info["cluster parameters path"] = testCluster.TempDir info["cluster parameters path"] = testCluster.TempDir
infoKeys = append(infoKeys, "cluster parameters path") infoKeys = append(infoKeys, "cluster parameters path")