mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
fix cert rotation function
This commit is contained in:
parent
f8ec6f905a
commit
436ff4ef63
@ -796,11 +796,5 @@ func expired(certFile string) bool {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
expirationDate := certificates[0].NotAfter
|
return certutil.IsCertExpired(certificates[0])
|
||||||
diffDays := expirationDate.Sub(time.Now()).Hours() / 24.0
|
|
||||||
if diffDays <= 90 {
|
|
||||||
logrus.Infof("certificate %s is about to expire", certFile)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user