less prone way to check if cert should be deleted

This commit is contained in:
Tony Li 2017-03-07 17:18:05 -05:00
parent 1f08f74959
commit c9f0bd08ca

View file

@ -867,7 +867,7 @@ func (l *L7) Cleanup() error {
l.tps = nil l.tps = nil
} }
// Delete the SSL cert if it is not a pre-created GCE cert. // 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) glog.Infof("Deleting sslcert %v", l.sslCert.Name)
if err := l.cloud.DeleteSslCertificate(l.sslCert.Name); err != nil { if err := l.cloud.DeleteSslCertificate(l.sslCert.Name); err != nil {
if !utils.IsHTTPErrorCode(err, http.StatusNotFound) { if !utils.IsHTTPErrorCode(err, http.StatusNotFound) {