fix ingress-nginx panic when the certificate format is wrong. (#7443)

* fix ingress-nginx panic when the certificate format is wrong.

Signed-off-by: wang_wenhu <976400757@qq.com>

* Add unit test.

Signed-off-by: wang_wenhu <976400757@qq.com>

* Update controller_test.go
This commit is contained in:
wenhuwang 2021-08-24 09:58:14 +08:00 committed by GitHub
parent c43ea4d6e1
commit 6593cb244b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 1 deletions

View file

@ -1493,7 +1493,7 @@ func extractTLSSecretName(host string, ing *ingress.Ingress,
continue
}
if cert == nil { // for tests
if cert == nil || cert.Certificate == nil {
continue
}