From c9f0bd08cab34923974639d0637bd10886eb9aa8 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 7 Mar 2017 17:18:05 -0500 Subject: [PATCH] less prone way to check if cert should be deleted --- controllers/gce/loadbalancers/loadbalancers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/gce/loadbalancers/loadbalancers.go b/controllers/gce/loadbalancers/loadbalancers.go index 8e3a21d48..054997afb 100644 --- a/controllers/gce/loadbalancers/loadbalancers.go +++ b/controllers/gce/loadbalancers/loadbalancers.go @@ -867,7 +867,7 @@ func (l *L7) Cleanup() error { l.tps = nil } // Delete the SSL cert if it is not a pre-created GCE cert. - if l.sslCert != nil && l.sslCert.Name != l.runtimeInfo.TLSName { + if l.sslCert != nil && l.runtimeInfo.TLSName != "" { glog.Infof("Deleting sslcert %v", l.sslCert.Name) if err := l.cloud.DeleteSslCertificate(l.sslCert.Name); err != nil { if !utils.IsHTTPErrorCode(err, http.StatusNotFound) {