Report expired certificates (#8045) (#8046)

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref 2021-12-23 15:02:29 -05:00 committed by GitHub
parent d6284d1672
commit 079d0cd415
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1332,7 +1332,10 @@ func (n *NGINXController) createServers(data []*ingress.Ingress,
servers[host].SSLCert = cert
if cert.ExpireTime.Before(time.Now().Add(240 * time.Hour)) {
now := time.Now()
if cert.ExpireTime.Before(now) {
klog.Warningf("SSL certificate for server %q expired (%v)", host, cert.ExpireTime)
} else if cert.ExpireTime.Before(now.Add(240 * time.Hour)) {
klog.Warningf("SSL certificate for server %q is about to expire (%v)", host, cert.ExpireTime)
}
}