Skip to content

Commit d2c5779

Browse files
authored
Merge pull request kubernetes#110776 from harry1064/remove-clock-pkg-scheduler
Use clock package from k8s.io/utils/clock
2 parents 11686e1 + fceb5cd commit d2c5779

File tree

2 files changed

+6
-39
lines changed

2 files changed

+6
-39
lines changed

pkg/scheduler/internal/queue/scheduling_queue.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import (
4646
"k8s.io/kubernetes/pkg/scheduler/internal/heap"
4747
"k8s.io/kubernetes/pkg/scheduler/metrics"
4848
"k8s.io/kubernetes/pkg/scheduler/util"
49+
"k8s.io/utils/clock"
4950
)
5051

5152
const (
@@ -136,7 +137,7 @@ type PriorityQueue struct {
136137
framework.PodNominator
137138

138139
stop chan struct{}
139-
clock util.Clock
140+
clock clock.Clock
140141

141142
// pod initial backoff duration.
142143
podInitialBackoffDuration time.Duration
@@ -175,7 +176,7 @@ type PriorityQueue struct {
175176
}
176177

177178
type priorityQueueOptions struct {
178-
clock util.Clock
179+
clock clock.Clock
179180
podInitialBackoffDuration time.Duration
180181
podMaxBackoffDuration time.Duration
181182
podMaxInUnschedulablePodsDuration time.Duration
@@ -186,8 +187,8 @@ type priorityQueueOptions struct {
186187
// Option configures a PriorityQueue
187188
type Option func(*priorityQueueOptions)
188189

189-
// WithClock sets clock for PriorityQueue, the default clock is util.RealClock.
190-
func WithClock(clock util.Clock) Option {
190+
// WithClock sets clock for PriorityQueue, the default clock is clock.RealClock.
191+
func WithClock(clock clock.Clock) Option {
191192
return func(o *priorityQueueOptions) {
192193
o.clock = clock
193194
}
@@ -229,7 +230,7 @@ func WithPodMaxInUnschedulablePodsDuration(duration time.Duration) Option {
229230
}
230231

231232
var defaultPriorityQueueOptions = priorityQueueOptions{
232-
clock: util.RealClock{},
233+
clock: clock.RealClock{},
233234
podInitialBackoffDuration: DefaultPodInitialBackoffDuration,
234235
podMaxBackoffDuration: DefaultPodMaxBackoffDuration,
235236
podMaxInUnschedulablePodsDuration: DefaultPodMaxInUnschedulablePodsDuration,

pkg/scheduler/util/clock.go

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)