Skip to content

Commit ac0635a

Browse files
committed
webhookcontroller: change cert lifetime argument to time.Duration
1 parent ee80340 commit ac0635a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/operator/webhooksupportabilitycontroller/degraded_webhook_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"regexp"
99
"strconv"
1010
"testing"
11+
"time"
1112

1213
"github.com/google/go-cmp/cmp"
1314
operatorv1 "github.com/openshift/api/operator/v1"
@@ -99,7 +100,7 @@ func doNotStart() func(*mockWebhookServer) {
99100

100101
func withWrongCABundle(t *testing.T) func(*mockWebhookServer) {
101102
return func(s *mockWebhookServer) {
102-
cfg, err := crypto.MakeSelfSignedCAConfig(t.Name()+"WrongCA", 10)
103+
cfg, err := crypto.MakeSelfSignedCAConfig(t.Name()+"WrongCA", 10*24*time.Hour)
103104
if err == nil {
104105
s.CABundle, _, err = cfg.GetPEMBytes()
105106
}
@@ -126,7 +127,7 @@ type mockWebhookServer struct {
126127
// Run starts the mock server. Port and CABundle are available after this method returns.
127128
func (s *mockWebhookServer) Run(t *testing.T, ctx context.Context) {
128129
// CA certs
129-
rootCACertCfg, err := crypto.MakeSelfSignedCAConfig(t.Name()+"RootCA", 10)
130+
rootCACertCfg, err := crypto.MakeSelfSignedCAConfig(t.Name()+"RootCA", 10*24*time.Hour)
130131
if err != nil {
131132
t.Fatal(err)
132133
}
@@ -141,7 +142,7 @@ func (s *mockWebhookServer) Run(t *testing.T, ctx context.Context) {
141142
s.CABundle = []byte{}
142143
}
143144
// server certs
144-
serverCertCfg, err := rootCA.MakeServerCert(sets.New(s.Hostname, "127.0.0.1"), 10)
145+
serverCertCfg, err := rootCA.MakeServerCert(sets.New(s.Hostname, "127.0.0.1"), 10*24*time.Hour)
145146
if err != nil {
146147
t.Fatal(err)
147148
}

0 commit comments

Comments
 (0)