Skip to content

Commit

Permalink
fix: misjudge certificate expiring (minio#2127)
Browse files Browse the repository at this point in the history
  • Loading branch information
usernameisnull authored May 22, 2024
1 parent 56c1e35 commit 1c2fa4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ func (c *Controller) getCustomCertificates(ctx context.Context, tenant *miniov2.
if expiresInDays > 0 && expiresInDays < 10 {
c.recorder.Event(tenant, corev1.EventTypeWarning, "CertificateExpiryImminent", fmt.Sprintf("%s certificate '%s' is expiring in %d days", certType, secret.Name, expiresInDays))
}
if expiresInDays > 0 && expiresInDays < 1 {
if expiresIn > 0 && expiresIn < 24*time.Hour {
expiresInHuman = fmt.Sprintf("%v hours, %v minutes, and %v seconds", expiresInHours, expiresInMinutes, expiresInSeconds)
}
if expiresInDays <= 0 {
if expiresIn <= 0 {
c.recorder.Event(tenant, corev1.EventTypeWarning, "CertificateExpired", fmt.Sprintf("%s certificate '%s' has expired", certType, secret.Name))
expiresInHuman = "EXPIRED"
}
Expand Down

0 comments on commit 1c2fa4f

Please sign in to comment.