From 46e54f2bc2091837331f6ed63d16f7d1e1fa0b6f Mon Sep 17 00:00:00 2001 From: Malte Isberner Date: Mon, 3 Oct 2022 11:33:34 +0200 Subject: [PATCH] Use the non-deprecated SimpleIntervalClock, because the test only requires a passive clock. --- pkg/internal/status/conditions.go | 2 +- pkg/internal/status/conditions_test.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/internal/status/conditions.go b/pkg/internal/status/conditions.go index aeef640f..0f9a442c 100644 --- a/pkg/internal/status/conditions.go +++ b/pkg/internal/status/conditions.go @@ -27,7 +27,7 @@ import ( // clock is used to set status condition timestamps. // This variable makes it easier to test conditions. -var clock kubeclock.Clock = &kubeclock.RealClock{} +var clock kubeclock.PassiveClock = &kubeclock.RealClock{} // ConditionType is the type of the condition and is typically a CamelCased // word or short phrase. diff --git a/pkg/internal/status/conditions_test.go b/pkg/internal/status/conditions_test.go index 4ebbb312..08b6f97d 100644 --- a/pkg/internal/status/conditions_test.go +++ b/pkg/internal/status/conditions_test.go @@ -41,16 +41,14 @@ func init() { func initConditions(init ...Condition) Conditions { // Use the same initial time for all initial conditions - clock = kubeclock.NewFakeClock(initTime) + clock = kubeclock.NewFakePassiveClock(initTime) conditions := Conditions{} for _, c := range init { conditions.SetCondition(c) } // Use an incrementing clock for the rest of the test - // This is deprecated but should be fine to use for now until we have a better solution - // nolint - clock = &kubeclock.IntervalClock{ + clock = &kubeclock.SimpleIntervalClock{ Time: initTime, Duration: clockInterval, }