Skip to content

Commit 1f4d148

Browse files
authored
Remove Boulder's understanding of FAKECLOCK (#8356)
We no longer set the FAKECLOCK environment variable in any integration tests, so remove the dead code which understood it. Closes #4934
1 parent 6e1615a commit 1f4d148

File tree

20 files changed

+41
-67
lines changed

20 files changed

+41
-67
lines changed

cmd/admin/admin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func newAdmin(configFile string, dryRun bool) (*admin, error) {
5252
defer oTelShutdown(context.Background())
5353
logger.Info(cmd.VersionString())
5454

55-
clk := cmd.Clock()
55+
clk := clock.New()
5656
features.Set(c.Admin.Features)
5757

5858
tlsConfig, err := c.Admin.TLS.Load(scope)

cmd/akamai-purger/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"sync"
1313
"time"
1414

15+
"github.com/jmhodges/clock"
1516
"github.com/prometheus/client_golang/prometheus"
1617
"google.golang.org/protobuf/types/known/emptypb"
1718

@@ -394,7 +395,7 @@ func manualPurge(purgeClient *akamai.CachePurgeClient, tag, tagFile string) {
394395

395396
// daemon initializes the akamai-purger gRPC service.
396397
func daemon(c Config, ap *akamaiPurger, logger blog.Logger, scope prometheus.Registerer) {
397-
clk := cmd.Clock()
398+
clk := clock.New()
398399

399400
tlsConfig, err := c.AkamaiPurger.TLS.Load(scope)
400401
cmd.FailOnError(err, "tlsConfig config")

cmd/bad-key-revoker/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ func main() {
327327
scope, logger, oTelShutdown := cmd.StatsAndLogging(config.Syslog, config.OpenTelemetry, config.BadKeyRevoker.DebugAddr)
328328
defer oTelShutdown(context.Background())
329329
logger.Info(cmd.VersionString())
330-
clk := cmd.Clock()
330+
clk := clock.New()
331331

332332
scope.MustRegister(keysProcessed)
333333
scope.MustRegister(certsRevoked)

cmd/boulder-ca/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"strconv"
99
"time"
1010

11+
"github.com/jmhodges/clock"
12+
1113
"github.com/letsencrypt/boulder/ca"
1214
capb "github.com/letsencrypt/boulder/ca/proto"
1315
"github.com/letsencrypt/boulder/cmd"
@@ -182,7 +184,7 @@ func main() {
182184
cmd.FailOnError(err, "Failed to load CT Log List")
183185
}
184186

185-
clk := cmd.Clock()
187+
clk := clock.New()
186188
var crlShards int
187189
issuers := make([]*issuance.Issuer, 0, len(c.CA.Issuance.Issuers))
188190
for i, issuerConfig := range c.CA.Issuance.Issuers {

cmd/boulder-publisher/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"runtime"
99

1010
ct "github.com/google/certificate-transparency-go"
11+
"github.com/jmhodges/clock"
1112

1213
"github.com/letsencrypt/boulder/cmd"
1314
"github.com/letsencrypt/boulder/features"
@@ -88,7 +89,7 @@ func main() {
8889
tlsConfig, err := c.Publisher.TLS.Load(scope)
8990
cmd.FailOnError(err, "TLS config")
9091

91-
clk := cmd.Clock()
92+
clk := clock.New()
9293

9394
pubi := publisher.New(bundles, c.Publisher.UserAgent, logger, scope)
9495

cmd/boulder-ra/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"flag"
66
"os"
77

8+
"github.com/jmhodges/clock"
9+
810
akamaipb "github.com/letsencrypt/boulder/akamai/proto"
911
capb "github.com/letsencrypt/boulder/ca/proto"
1012
"github.com/letsencrypt/boulder/cmd"
@@ -184,7 +186,7 @@ func main() {
184186
tlsConfig, err := c.RA.TLS.Load(scope)
185187
cmd.FailOnError(err, "TLS config")
186188

187-
clk := cmd.Clock()
189+
clk := clock.New()
188190

189191
vaConn, err := bgrpc.ClientSetup(c.RA.VAService, tlsConfig, scope, clk)
190192
cmd.FailOnError(err, "Unable to create VA client")

cmd/boulder-sa/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"flag"
66
"os"
77

8+
"github.com/jmhodges/clock"
9+
810
"github.com/letsencrypt/boulder/cmd"
911
"github.com/letsencrypt/boulder/config"
1012
"github.com/letsencrypt/boulder/features"
@@ -75,7 +77,7 @@ func main() {
7577
cmd.FailOnError(err, "While initializing dbIncidentsMap")
7678
}
7779

78-
clk := cmd.Clock()
80+
clk := clock.New()
7981

8082
parallel := c.SA.ParallelismPerRPC
8183
if parallel < 1 {

cmd/boulder-va/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"os"
77
"time"
88

9+
"github.com/jmhodges/clock"
10+
911
"github.com/letsencrypt/boulder/bdns"
1012
"github.com/letsencrypt/boulder/cmd"
1113
"github.com/letsencrypt/boulder/features"
@@ -78,7 +80,7 @@ func main() {
7880
scope, logger, oTelShutdown := cmd.StatsAndLogging(c.Syslog, c.OpenTelemetry, c.VA.DebugAddr)
7981
defer oTelShutdown(context.Background())
8082
logger.Info(cmd.VersionString())
81-
clk := cmd.Clock()
83+
clk := clock.New()
8284

8385
var servers bdns.ServerProvider
8486

cmd/boulder-wfe2/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
"os"
1111
"time"
1212

13+
"github.com/jmhodges/clock"
14+
1315
"github.com/letsencrypt/boulder/cmd"
1416
"github.com/letsencrypt/boulder/config"
1517
emailpb "github.com/letsencrypt/boulder/email/proto"
@@ -261,7 +263,7 @@ func main() {
261263
stats, logger, oTelShutdown := cmd.StatsAndLogging(c.Syslog, c.OpenTelemetry, c.WFE.DebugAddr)
262264
logger.Info(cmd.VersionString())
263265

264-
clk := cmd.Clock()
266+
clk := clock.New()
265267

266268
var unpauseSigner unpause.JWTSigner
267269
if features.Get().CheckIdentifiersPaused {

cmd/cert-checker/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ func main() {
630630

631631
checker := newChecker(
632632
saDbMap,
633-
cmd.Clock(),
633+
clock.New(),
634634
pa,
635635
kp,
636636
config.CertChecker.CheckPeriod.Duration,

0 commit comments

Comments
 (0)