Skip to content

Commit

Permalink
Merge pull request #110776 from harry1064/remove-clock-pkg-scheduler
Browse files Browse the repository at this point in the history
Use clock package from k8s.io/utils/clock
  • Loading branch information
k8s-ci-robot committed Jun 25, 2022
2 parents 11686e1 + fceb5cd commit d2c5779
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 39 deletions.
11 changes: 6 additions & 5 deletions pkg/scheduler/internal/queue/scheduling_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
"k8s.io/kubernetes/pkg/scheduler/internal/heap"
"k8s.io/kubernetes/pkg/scheduler/metrics"
"k8s.io/kubernetes/pkg/scheduler/util"
"k8s.io/utils/clock"
)

const (
Expand Down Expand Up @@ -136,7 +137,7 @@ type PriorityQueue struct {
framework.PodNominator

stop chan struct{}
clock util.Clock
clock clock.Clock

// pod initial backoff duration.
podInitialBackoffDuration time.Duration
Expand Down Expand Up @@ -175,7 +176,7 @@ type PriorityQueue struct {
}

type priorityQueueOptions struct {
clock util.Clock
clock clock.Clock
podInitialBackoffDuration time.Duration
podMaxBackoffDuration time.Duration
podMaxInUnschedulablePodsDuration time.Duration
Expand All @@ -186,8 +187,8 @@ type priorityQueueOptions struct {
// Option configures a PriorityQueue
type Option func(*priorityQueueOptions)

// WithClock sets clock for PriorityQueue, the default clock is util.RealClock.
func WithClock(clock util.Clock) Option {
// WithClock sets clock for PriorityQueue, the default clock is clock.RealClock.
func WithClock(clock clock.Clock) Option {
return func(o *priorityQueueOptions) {
o.clock = clock
}
Expand Down Expand Up @@ -229,7 +230,7 @@ func WithPodMaxInUnschedulablePodsDuration(duration time.Duration) Option {
}

var defaultPriorityQueueOptions = priorityQueueOptions{
clock: util.RealClock{},
clock: clock.RealClock{},
podInitialBackoffDuration: DefaultPodInitialBackoffDuration,
podMaxBackoffDuration: DefaultPodMaxBackoffDuration,
podMaxInUnschedulablePodsDuration: DefaultPodMaxInUnschedulablePodsDuration,
Expand Down
34 changes: 0 additions & 34 deletions pkg/scheduler/util/clock.go

This file was deleted.

0 comments on commit d2c5779

Please sign in to comment.