From 635ee5ad553aabf55479fc3e04431b02c8c6801a Mon Sep 17 00:00:00 2001 From: Bowei Du Date: Mon, 2 Apr 2018 23:34:08 -0700 Subject: [PATCH] Add support for multiple certificates to targetproxy --- pkg/cloudprovider/providers/gce/gce_targetproxy.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/cloudprovider/providers/gce/gce_targetproxy.go b/pkg/cloudprovider/providers/gce/gce_targetproxy.go index 47a9626fee8..e04095a4e39 100644 --- a/pkg/cloudprovider/providers/gce/gce_targetproxy.go +++ b/pkg/cloudprovider/providers/gce/gce_targetproxy.go @@ -85,10 +85,14 @@ func (gce *GCECloud) SetUrlMapForTargetHttpsProxy(proxy *compute.TargetHttpsProx } // 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") + var allCerts []string + for _, cert := range sslCerts { + allCerts = append(allCerts, cert.SelfLink) + } req := &compute.TargetHttpsProxiesSetSslCertificatesRequest{ - SslCertificates: []string{sslCert.SelfLink}, + SslCertificates: allCerts, } return mc.Observe(gce.c.TargetHttpsProxies().SetSslCertificates(context.Background(), meta.GlobalKey(proxy.Name), req)) }