fix error when cert or key is nil

This commit is contained in:
Arno Uhlig 2017-09-18 16:38:23 +02:00
parent 1a68536e29
commit 003667ff2e

View file

@ -85,6 +85,9 @@ func (ic *GenericController) getPemCertificate(secretName string) (*ingress.SSLC
var s *ingress.SSLCert
if okcert && okkey {
if cert == nil || key == nil {
return nil, fmt.Errorf("error retrieving cert or key from secret %v: %v", secretName, err)
}
s, err = ssl.AddOrUpdateCertAndKey(nsSecName, cert, key, ca)
if err != nil {
return nil, fmt.Errorf("unexpected error creating pem file %v", err)