Skip to content

Commit

Permalink
Fix csrsigning controller test (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
HomayoonAlimohammadi authored Aug 26, 2024
1 parent 0bf274d commit 96634b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/k8s/pkg/k8sd/controllers/csrsigning/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"crypto/x509/pkix"
"errors"
"testing"
"time"

. "github.com/onsi/gomega"
certv1 "k8s.io/api/certificates/v1"
Expand Down Expand Up @@ -452,7 +453,7 @@ func TestUpdateCSRFailed(t *testing.T) {
nil,
)

caCert, caKey, err := pkiutil.GenerateSelfSignedCA(pkix.Name{CommonName: "kubernetes-ca"}, 10, 2048)
caCert, caKey, err := pkiutil.GenerateSelfSignedCA(pkix.Name{CommonName: "kubernetes-ca"}, time.Now(), time.Now().AddDate(10, 0, 0), 2048)
g.Expect(err).ToNot(HaveOccurred())

reconciler := &csrSigningReconciler{
Expand Down Expand Up @@ -513,7 +514,7 @@ func TestUpdateCSRSucceed(t *testing.T) {
nil,
)

caCert, caKey, err := pkiutil.GenerateSelfSignedCA(pkix.Name{CommonName: "kubernetes-ca"}, 10, 2048)
caCert, caKey, err := pkiutil.GenerateSelfSignedCA(pkix.Name{CommonName: "kubernetes-ca"}, time.Now(), time.Now().AddDate(10, 0, 0), 2048)
g.Expect(err).ToNot(HaveOccurred())

reconciler := &csrSigningReconciler{
Expand Down

0 comments on commit 96634b2

Please sign in to comment.