Skip to content

Commit 1375ea2

Browse files
authored
Use the non-deprecated SimpleIntervalClock fake kubeclock (#199)
1 parent 6f61067 commit 1375ea2

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

pkg/internal/status/conditions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727

2828
// clock is used to set status condition timestamps.
2929
// This variable makes it easier to test conditions.
30-
var clock kubeclock.Clock = &kubeclock.RealClock{}
30+
var clock kubeclock.PassiveClock = &kubeclock.RealClock{}
3131

3232
// ConditionType is the type of the condition and is typically a CamelCased
3333
// word or short phrase.

pkg/internal/status/conditions_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,14 @@ func init() {
4141

4242
func initConditions(init ...Condition) Conditions {
4343
// Use the same initial time for all initial conditions
44-
clock = kubeclock.NewFakeClock(initTime)
44+
clock = kubeclock.NewFakePassiveClock(initTime)
4545
conditions := Conditions{}
4646
for _, c := range init {
4747
conditions.SetCondition(c)
4848
}
4949

5050
// Use an incrementing clock for the rest of the test
51-
// This is deprecated but should be fine to use for now until we have a better solution
52-
// nolint
53-
clock = &kubeclock.IntervalClock{
51+
clock = &kubeclock.SimpleIntervalClock{
5452
Time: initTime,
5553
Duration: clockInterval,
5654
}

0 commit comments

Comments
 (0)