Skip to content

Commit dd8c745

Browse files
committed
Add missing clock arguments
After recent dependency bumps, the signature of some functions has changed. Update their usage.
1 parent fa1b5c8 commit dd8c745

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

cmd/updatestatuscontroller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55

66
k8sversion "k8s.io/apimachinery/pkg/version"
7+
"k8s.io/utils/clock"
78

89
"github.com/openshift/library-go/pkg/controller/controllercmd"
910

@@ -19,6 +20,7 @@ func init() {
1920
// https://github.com/openshift/cluster-version-operator/pull/1091#discussion_r1810601697
2021
k8sversion.Info{GitVersion: cvoversion.Raw},
2122
updatestatus.Run,
23+
clock.RealClock{},
2224
).NewCommandWithContext(context.Background())
2325

2426
uscCommand.Short = "The Update Status Controller watches cluster state/health during the update process and exposes it through the UpdateStatus API."

pkg/updatestatus/controlplaneinformer_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/google/go-cmp/cmp"
1313
"github.com/google/go-cmp/cmp/cmpopts"
1414
"gopkg.in/yaml.v3"
15+
clocktesting "k8s.io/utils/clock/testing"
1516
"k8s.io/utils/ptr"
1617

1718
appsv1 "k8s.io/api/apps/v1"
@@ -642,7 +643,7 @@ func (c testSyncContext) Recorder() events.Recorder {
642643
func newTestSyncContext(queueKey string) factory.SyncContext {
643644
return testSyncContext{
644645
queueKey: queueKey,
645-
eventRecorder: events.NewInMemoryRecorder("test"),
646+
eventRecorder: events.NewInMemoryRecorder("test", clocktesting.NewFakePassiveClock(time.Now())),
646647
}
647648
}
648649

pkg/updatestatus/updatestatuscontroller_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"k8s.io/apimachinery/pkg/util/wait"
1313
"k8s.io/client-go/kubernetes/fake"
1414
"k8s.io/client-go/util/workqueue"
15+
clocktesting "k8s.io/utils/clock/testing"
1516
)
1617

1718
func Test_updateStatusController(t *testing.T) {
@@ -153,7 +154,7 @@ func Test_updateStatusController(t *testing.T) {
153154

154155
func newTestSyncContextWithQueue() factory.SyncContext {
155156
return testSyncContext{
156-
eventRecorder: events.NewInMemoryRecorder("test"),
157+
eventRecorder: events.NewInMemoryRecorder("test", clocktesting.NewFakePassiveClock(time.Now())),
157158
queue: workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[any]()),
158159
}
159160
}

0 commit comments

Comments
 (0)