From 8afd6780b4a888992c81a334e7a3f4c9060b0877 Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Thu, 9 Dec 2021 12:21:28 -0500 Subject: [PATCH] Note dishonesty of IntervalClock --- staging/src/k8s.io/apimachinery/pkg/util/clock/clock.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/clock/clock.go b/staging/src/k8s.io/apimachinery/pkg/util/clock/clock.go index ff0914f991b..ff97612df16 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/clock/clock.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/clock/clock.go @@ -66,7 +66,12 @@ func NewFakeClock(t time.Time) *testclocks.FakeClock { // IntervalClock implements Clock, but each invocation of Now steps // the clock forward the specified duration. // -// Deprecated: Use k8s.io/utils/clock/testing.IntervalClock instead. +// WARNING: most of the Clock methods just `panic`; +// only PassiveClock is honestly implemented. +// The alternative, SimpleIntervalClock, has only the +// PassiveClock methods. +// +// Deprecated: Use k8s.io/utils/clock/testing.SimpleIntervalClock instead. type IntervalClock = testclocks.IntervalClock // Timer allows for injecting fake or real timers into code that