Check errors generating pem files
@@ -89,10 +89,16 @@ func (ic *GenericController) getPemCertificate(secretName string) (*ingress.SSLC
var s *ingress.SSLCert
if okcert && okkey {
s, err = ssl.AddOrUpdateCertAndKey(nsSecName, cert, key, ca)
+ if err != nil {
+ return nil, fmt.Errorf("unexpected error creating pem file %v", err)
+ }
glog.V(3).Infof("found certificate and private key, configuring %v as a TLS Secret (CN: %v)", secretName, s.CN)
} else if ca != nil {
glog.V(3).Infof("found only ca.crt, configuring %v as an Certificate Authentication secret", secretName)
s, err = ssl.AddCertAuth(nsSecName, ca)
+ if err != nil {
+ return nil, fmt.Errorf("unexpected error creating pem file %v", err)
+ }
} else {
return nil, fmt.Errorf("no keypair or CA cert could be found in %v", secretName)
}
