Merge pull request #1402 from auhlig/nilpointerfix

fix error when cert or key is nil
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-09-24 12:30:12 -07:00 committed by GitHub
commit 5a24f4d3bd

View file

@ -81,6 +81,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)