From 5b82df92fae520c7c7be31d8ded6d8d190ca0892 Mon Sep 17 00:00:00 2001 From: ncabatoff Date: Wed, 5 Feb 2020 13:45:16 -0500 Subject: [PATCH] Changes needed so that benchmark-vault can run with Prometheus monitoring (#8295) --- vault/testing.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vault/testing.go b/vault/testing.go index 2686b845a2..6389bcf67b 100644 --- a/vault/testing.go +++ b/vault/testing.go @@ -1222,7 +1222,9 @@ func NewTestCluster(t testing.T, base *CoreConfig, opts *TestClusterOptions) *Te Subject: pkix.Name{ CommonName: "localhost", }, - DNSNames: []string{"localhost"}, + // Include host.docker.internal for the sake of benchmark-vault running on MacOS/Windows. + // This allows Prometheus running in docker to scrape the cluster for metrics. + DNSNames: []string{"localhost", "host.docker.internal"}, IPAddresses: certIPs, ExtKeyUsage: []x509.ExtKeyUsage{ x509.ExtKeyUsageServerAuth, @@ -1307,6 +1309,7 @@ func NewTestCluster(t testing.T, base *CoreConfig, opts *TestClusterOptions) *Te } certGetter := reload.NewCertificateGetter(certFile, keyFile, "") certGetters = append(certGetters, certGetter) + certGetter.Reload(nil) tlsConfig := &tls.Config{ Certificates: []tls.Certificate{tlsCert}, RootCAs: testCluster.RootCAs,