Skip to content

Commit

Permalink
fix: Use actual warningPeriod in certmonitor
Browse files Browse the repository at this point in the history
Signed-off-by: Koen de Laat <koen.de.laat@philips.com>
  • Loading branch information
koendelaat authored and brandond committed Jun 3, 2024
1 parent 1268779 commit 79ba10f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/certmonitor/certmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func checkCerts(fileMap map[string][]string, warningPeriod time.Duration) error
} else if now.After(cert.NotAfter) {
errs = append(errs, fmt.Errorf("%s/%s: certificate %s expired at %s", service, basename, cert.Subject, cert.NotAfter.Format(time.RFC3339)))
} else if warn.After(cert.NotAfter) {
errs = append(errs, fmt.Errorf("%s/%s: certificate %s will expire within %d days at %s", service, basename, cert.Subject, daemonconfig.CertificateRenewDays, cert.NotAfter.Format(time.RFC3339)))
errs = append(errs, fmt.Errorf("%s/%s: certificate %s will expire within %d days at %s", service, basename, cert.Subject, int(warningPeriod.Hours()/24), cert.NotAfter.Format(time.RFC3339)))
}
}
}
Expand Down

0 comments on commit 79ba10f

Please sign in to comment.