Backport go 1.15 changes for 0-10-0 (#1334)

* pkg/storage/redis: use SANs cert

Since go1.15, X.509 CommonName is deprecated, switch to a SANs
certificate for test redis TLS.

While at it, add instruction to genearte cert and build test image.

See: https://golang.org/doc/go1.15#commonname

* config: do not test for exact route id

Different go version can genearte different route id, due to the fact
that we are relying on xxhash.

* internal/controlplane: mocking policy name in test

We don't have to test for exact policy name, as it does not make sense
and force us to change test every new go release.

Co-authored-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
Travis Groth 2020-08-25 16:59:36 -04:00 committed by GitHub
parent 9efeabd956
commit 683c591f14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 205 additions and 147 deletions

View file

@ -171,10 +171,6 @@ func inlineFilename(name string) *envoy_config_core_v3.DataSource {
}
}
func getPolicyName(policy *config.Policy) string {
return fmt.Sprintf("policy-%x", policy.RouteID())
}
func envoyTLSCertificateFromGoTLSCertificate(cert *tls.Certificate) *envoy_extensions_transport_sockets_tls_v3.TlsCertificate {
envoyCert := &envoy_extensions_transport_sockets_tls_v3.TlsCertificate{}
var chain bytes.Buffer