From a56121c191933984e51c23ae0b9ea384752f8173 Mon Sep 17 00:00:00 2001 From: "Da K. Ma" Date: Sun, 22 Jul 2018 20:56:53 +0800 Subject: [PATCH] Removed unused functions. Signed-off-by: Da K. Ma --- pkg/controller/daemon/daemon_controller.go | 13 ------------- pkg/controller/job/job_controller.go | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/pkg/controller/daemon/daemon_controller.go b/pkg/controller/daemon/daemon_controller.go index 92cdb15b9ca..72ce8a8b6a5 100644 --- a/pkg/controller/daemon/daemon_controller.go +++ b/pkg/controller/daemon/daemon_controller.go @@ -1493,19 +1493,6 @@ func Predicates(pod *v1.Pod, nodeInfo *schedulercache.NodeInfo) (bool, []algorit return len(predicateFails) == 0, predicateFails, nil } -// byCreationTimestamp sorts a list by creation timestamp, using their names as a tie breaker. -type byCreationTimestamp []*apps.DaemonSet - -func (o byCreationTimestamp) Len() int { return len(o) } -func (o byCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } - -func (o byCreationTimestamp) Less(i, j int) bool { - if o[i].CreationTimestamp.Equal(&o[j].CreationTimestamp) { - return o[i].Name < o[j].Name - } - return o[i].CreationTimestamp.Before(&o[j].CreationTimestamp) -} - type podByCreationTimestampAndPhase []*v1.Pod func (o podByCreationTimestampAndPhase) Len() int { return len(o) } diff --git a/pkg/controller/job/job_controller.go b/pkg/controller/job/job_controller.go index 7578653d3dd..d544e23c236 100644 --- a/pkg/controller/job/job_controller.go +++ b/pkg/controller/job/job_controller.go @@ -866,16 +866,3 @@ func filterPods(pods []*v1.Pod, phase v1.PodPhase) int { } return result } - -// byCreationTimestamp sorts a list by creation timestamp, using their names as a tie breaker. -type byCreationTimestamp []batch.Job - -func (o byCreationTimestamp) Len() int { return len(o) } -func (o byCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } - -func (o byCreationTimestamp) Less(i, j int) bool { - if o[i].CreationTimestamp.Equal(&o[j].CreationTimestamp) { - return o[i].Name < o[j].Name - } - return o[i].CreationTimestamp.Before(&o[j].CreationTimestamp) -}