Update deps for consul-template 0.29.0 (#15293)

This requires bumping https://github.com/mitchellh/go-testing-interface.
For this new version, we have to create a wrapper to convert
the stdlib `testing.TB` interface to the
`mitchellh/go-testing-interface` `T` interface, since it uses
`Parallel()` now, which is not supported by `testing.TB`. This had to be
added to a new package, `benchhelpers`, to avoid a circular dependency
in `testhelpers`.

We also have to *unbump* https://github.com/armon/go-metrics since
updating it breaks our usage of
https://github.com/google/go-metrics-stackdriver

I verified that the new `pkiCert` template function works with agent
injection using annotations like:

```yaml
vault.hashicorp.com/agent-inject-secret-sample.crt: "pki/issue/example-dot-com"
vault.hashicorp.com/agent-inject-template-sample.crt: |
  {{ pkiCert "pki/issue/example-dot-com" "common_name=foo.example.com" "ttl=1h" }}
```
This commit is contained in:
Christopher Swenson
2022-05-05 10:30:40 -07:00
committed by GitHub
parent c22aa710a5
commit df0b95d774
11 changed files with 64 additions and 35 deletions

View File

@@ -16,6 +16,7 @@ import (
"github.com/hashicorp/vault/builtin/logical/pki"
"github.com/hashicorp/vault/builtin/logical/ssh"
"github.com/hashicorp/vault/builtin/logical/transit"
"github.com/hashicorp/vault/helper/benchhelpers"
"github.com/hashicorp/vault/helper/builtinplugins"
"github.com/hashicorp/vault/sdk/helper/logging"
"github.com/hashicorp/vault/sdk/logical"
@@ -125,7 +126,7 @@ func testVaultServerPluginDir(tb testing.TB, pluginDir string) (*api.Client, []s
func testVaultServerCoreConfig(tb testing.TB, coreConfig *vault.CoreConfig) (*api.Client, []string, func()) {
tb.Helper()
cluster := vault.NewTestCluster(tb, coreConfig, &vault.TestClusterOptions{
cluster := vault.NewTestCluster(benchhelpers.TBtoT(tb), coreConfig, &vault.TestClusterOptions{
HandlerFunc: vaulthttp.Handler,
NumCores: 1, // Default is 3, but we don't need that many
})
@@ -133,7 +134,7 @@ func testVaultServerCoreConfig(tb testing.TB, coreConfig *vault.CoreConfig) (*ap
// Make it easy to get access to the active
core := cluster.Cores[0].Core
vault.TestWaitActive(tb, core)
vault.TestWaitActive(benchhelpers.TBtoT(tb), core)
// Get the client already setup for us!
client := cluster.Cores[0].Client