Merge pull request #62051 from bowei/add-multi-cert

Automatic merge from submit-queue (batch tested with PRs 60983, 62012, 61892, 62051, 62067). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add support for multiple certificates to targetproxy

```release-note
NONE
```
pull/8/head
Kubernetes Submit Queue 2018-04-03 11:33:19 -07:00 committed by GitHub
commit 47105a5e67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -85,10 +85,14 @@ func (gce *GCECloud) SetUrlMapForTargetHttpsProxy(proxy *compute.TargetHttpsProx
} }
// SetSslCertificateForTargetHttpsProxy sets the given SslCertificate for the given TargetHttpsProxy. // SetSslCertificateForTargetHttpsProxy sets the given SslCertificate for the given TargetHttpsProxy.
func (gce *GCECloud) SetSslCertificateForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, sslCert *compute.SslCertificate) error { func (gce *GCECloud) SetSslCertificateForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, sslCerts []*compute.SslCertificate) error {
mc := newTargetProxyMetricContext("set_ssl_cert") mc := newTargetProxyMetricContext("set_ssl_cert")
var allCerts []string
for _, cert := range sslCerts {
allCerts = append(allCerts, cert.SelfLink)
}
req := &compute.TargetHttpsProxiesSetSslCertificatesRequest{ req := &compute.TargetHttpsProxiesSetSslCertificatesRequest{
SslCertificates: []string{sslCert.SelfLink}, SslCertificates: allCerts,
} }
return mc.Observe(gce.c.TargetHttpsProxies().SetSslCertificates(context.Background(), meta.GlobalKey(proxy.Name), req)) return mc.Observe(gce.c.TargetHttpsProxies().SetSslCertificates(context.Background(), meta.GlobalKey(proxy.Name), req))
} }