Changes needed so that benchmark-vault can run with Prometheus monitoring (#8295)

This commit is contained in:
ncabatoff 2020-02-05 13:45:16 -05:00 committed by GitHub
parent 02db2b54d3
commit 5b82df92fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,