Merge pull request #63407 from nicksardo/change-setsslcert

Automatic merge from submit-queue. 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>.

GCE: Pass certificate URLs instead of the certificate structs

**What this PR does / why we need it**:
Simplify callers by passing in only what's necessary - a slice of URLs.

**Special notes for your reviewer**:
/assign @MrHohn 
/cc @MrHohn 

**Release note**:
```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-05-03 18:41:39 -07:00 committed by GitHub
commit bb4745da99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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