Skip to content

Commit 4a32670

Browse files
authored
Merge pull request #5114 from rxy0210/master
Improve code reusability
2 parents cc7b9ac + 11f8fe3 commit 4a32670

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

operator/pkg/certs/certs.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,6 @@ func NewSignedCert(cc *CertConfig, key crypto.Signer, caCert *x509.Certificate,
347347
}
348348

349349
RemoveDuplicateAltNames(&cc.Config.AltNames)
350-
notAfter := time.Now().Add(constants.CertificateValidity).UTC()
351-
if cc.NotAfter != nil {
352-
notAfter = *cc.NotAfter
353-
}
354350

355351
certTmpl := x509.Certificate{
356352
Subject: pkix.Name{
@@ -361,7 +357,7 @@ func NewSignedCert(cc *CertConfig, key crypto.Signer, caCert *x509.Certificate,
361357
IPAddresses: cc.Config.AltNames.IPs,
362358
SerialNumber: serial,
363359
NotBefore: caCert.NotBefore,
364-
NotAfter: notAfter,
360+
NotAfter: cc.NotAfter.UTC(),
365361
KeyUsage: keyUsage,
366362
ExtKeyUsage: cc.Config.Usages,
367363
BasicConstraintsValid: true,

0 commit comments

Comments
 (0)