GCE pre-shared cert fixes (#395)
* pick up changes to the external cert referenced by lb * less prone way to check if cert should be deleted
This commit is contained in:
parent
e1d1445370
commit
7000924dc5
1 changed files with 2 additions and 7 deletions
|
@ -356,11 +356,6 @@ func (l *L7) checkSSLCert() (err error) {
|
|||
|
||||
// Use the named GCE cert when it is specified by the annotation.
|
||||
if certName != "" {
|
||||
// Use the targetHTTPSProxy's cert name if it already has one set.
|
||||
if l.sslCert != nil {
|
||||
certName = l.sslCert.Name
|
||||
}
|
||||
|
||||
// Ask GCE for the cert, checking for problems and existence.
|
||||
cert, err := l.cloud.GetSslCertificate(certName)
|
||||
if err != nil {
|
||||
|
@ -871,8 +866,8 @@ 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 {
|
||||
// Delete the SSL cert if it is from a secret, not referencing a pre-created GCE cert.
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue