renew: don't use Renew, just create a new cert

This commit is contained in:
Mikaël Cluseau 2023-01-27 06:42:39 +01:00
parent 227c341f6b
commit 811a3bddfd

View File

@ -226,19 +226,7 @@ func (sd *SecretData) RenewCACert(cluster, name string) (err error) {
return
}
var newCert []byte
cert, err := helpers.ParseCertificatePEM(ca.Cert)
if err == nil {
newCert, err = initca.RenewFromSigner(cert, signer)
}
if err != nil {
// failed to load or renew, create a new cert from the existing key
req := newCACertReq()
newCert, _, err = initca.NewFromSigner(req, signer)
}
newCert, _, err := initca.NewFromSigner(newCACertReq(), signer)
if err != nil {
return
}