From dc49afcc6b943bc4364d0c756a2e767c3f70859d Mon Sep 17 00:00:00 2001 From: TommyLike Date: Thu, 14 Mar 2019 11:24:44 +0800 Subject: [PATCH] Fix Typos --- pkg/scheduler/actions/reclaim/reclaim.go | 2 +- pkg/scheduler/api/helpers.go | 2 +- pkg/scheduler/api/job_info.go | 2 +- pkg/scheduler/cache/event_handlers.go | 2 +- pkg/scheduler/plugins/drf/drf.go | 4 ++-- pkg/scheduler/plugins/predicates/predicates.go | 4 ++-- pkg/scheduler/plugins/priority/priority.go | 4 ++-- pkg/scheduler/plugins/proportion/proportion.go | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/scheduler/actions/reclaim/reclaim.go b/pkg/scheduler/actions/reclaim/reclaim.go index e113a65a9..0bc2412fc 100644 --- a/pkg/scheduler/actions/reclaim/reclaim.go +++ b/pkg/scheduler/actions/reclaim/reclaim.go @@ -176,7 +176,7 @@ func (alloc *reclaimAction) Execute(ssn *framework.Session) { if task.Resreq.LessEqual(reclaimed) { if err := ssn.Pipeline(task, n.Name); err != nil { - glog.Errorf("Failed to pipline Task <%s/%s> on Node <%s>", + glog.Errorf("Failed to pipeline Task <%s/%s> on Node <%s>", task.Namespace, task.Name, n.Name) } diff --git a/pkg/scheduler/api/helpers.go b/pkg/scheduler/api/helpers.go index 90a6eec8c..194c208a5 100644 --- a/pkg/scheduler/api/helpers.go +++ b/pkg/scheduler/api/helpers.go @@ -96,7 +96,7 @@ func MergeErrors(errs ...error) error { return nil } -// JobTerminated checkes whether job was terminated. +// JobTerminated checks whether job was terminated. func JobTerminated(job *JobInfo) bool { return job.PodGroup == nil && job.PDB == nil && diff --git a/pkg/scheduler/api/job_info.go b/pkg/scheduler/api/job_info.go index 297bf9df4..68799bcb4 100644 --- a/pkg/scheduler/api/job_info.go +++ b/pkg/scheduler/api/job_info.go @@ -141,7 +141,7 @@ type JobInfo struct { CreationTimestamp metav1.Time PodGroup *v1alpha1.PodGroup - // TODO(k82cn): keep backward compatbility, removed it when v1alpha1 finalized. + // TODO(k82cn): keep backward compatibility, removed it when v1alpha1 finalized. PDB *policyv1.PodDisruptionBudget } diff --git a/pkg/scheduler/cache/event_handlers.go b/pkg/scheduler/cache/event_handlers.go index 72055f3b2..6834fd58f 100644 --- a/pkg/scheduler/cache/event_handlers.go +++ b/pkg/scheduler/cache/event_handlers.go @@ -363,7 +363,7 @@ func (sc *SchedulerCache) setPodGroup(ss *kbv1.PodGroup) error { job := getJobID(ss) if len(job) == 0 { - return fmt.Errorf("the controller of PodGroup is empty") + return fmt.Errorf("the identity of PodGroup is empty") } if _, found := sc.Jobs[job]; !found { diff --git a/pkg/scheduler/plugins/drf/drf.go b/pkg/scheduler/plugins/drf/drf.go index 246c23e6f..8826cc62e 100644 --- a/pkg/scheduler/plugins/drf/drf.go +++ b/pkg/scheduler/plugins/drf/drf.go @@ -110,8 +110,8 @@ func (drf *drfPlugin) OnSessionOpen(ssn *framework.Session) { lv := l.(*api.JobInfo) rv := r.(*api.JobInfo) - glog.V(4).Infof("DRF JobOrderFn: <%v/%v> is ready: %d, <%v/%v> is ready: %d", - lv.Namespace, lv.Name, lv.Priority, rv.Namespace, rv.Name, rv.Priority) + glog.V(4).Infof("DRF JobOrderFn: <%v/%v> share state: %d, <%v/%v> share state: %d", + lv.Namespace, lv.Name, drf.jobOpts[lv.UID].share, rv.Namespace, rv.Name, drf.jobOpts[rv.UID].share) if drf.jobOpts[lv.UID].share == drf.jobOpts[rv.UID].share { return 0 diff --git a/pkg/scheduler/plugins/predicates/predicates.go b/pkg/scheduler/plugins/predicates/predicates.go index d19090423..a1be4997e 100644 --- a/pkg/scheduler/plugins/predicates/predicates.go +++ b/pkg/scheduler/plugins/predicates/predicates.go @@ -123,10 +123,10 @@ func (pp *predicatesPlugin) OnSessionOpen(ssn *framework.Session) { nodeInfo.SetNode(node.Node) if node.Allocatable.MaxTaskNum <= len(nodeInfo.Pods()) { - return fmt.Errorf("Node <%s> can not allow more task running on it.", node.Name) + return fmt.Errorf("node <%s> can not allow more task running on it", node.Name) } - // NodeSeletor Predicate + // NodeSelector Predicate fit, _, err := predicates.PodMatchNodeSelector(task.Pod, nil, nodeInfo) if err != nil { return err diff --git a/pkg/scheduler/plugins/priority/priority.go b/pkg/scheduler/plugins/priority/priority.go index edb4ac475..31c1e5091 100644 --- a/pkg/scheduler/plugins/priority/priority.go +++ b/pkg/scheduler/plugins/priority/priority.go @@ -38,7 +38,7 @@ func (pp *priorityPlugin) OnSessionOpen(ssn *framework.Session) { lv := l.(*api.TaskInfo) rv := r.(*api.TaskInfo) - glog.V(4).Infof("Priority TaskOrder: <%v/%v> prority is %v, <%v/%v> priority is %v", + glog.V(4).Infof("Priority TaskOrder: <%v/%v> priority is %v, <%v/%v> priority is %v", lv.Namespace, lv.Name, lv.Priority, rv.Namespace, rv.Name, rv.Priority) if lv.Priority == rv.Priority { @@ -59,7 +59,7 @@ func (pp *priorityPlugin) OnSessionOpen(ssn *framework.Session) { lv := l.(*api.JobInfo) rv := r.(*api.JobInfo) - glog.V(4).Infof("Priority JobOrderFn: <%v/%v> is ready: %d, <%v/%v> is ready: %d", + glog.V(4).Infof("Priority JobOrderFn: <%v/%v> priority: %d, <%v/%v> priority: %d", lv.Namespace, lv.Name, lv.Priority, rv.Namespace, rv.Name, rv.Priority) if lv.Priority > rv.Priority { diff --git a/pkg/scheduler/plugins/proportion/proportion.go b/pkg/scheduler/plugins/proportion/proportion.go index 582adf3f4..a536c6834 100644 --- a/pkg/scheduler/plugins/proportion/proportion.go +++ b/pkg/scheduler/plugins/proportion/proportion.go @@ -166,7 +166,7 @@ func (pp *proportionPlugin) OnSessionOpen(ssn *framework.Session) { } allocated := allocations[job.Queue] if allocated.Less(reclaimee.Resreq) { - glog.Errorf("Failed to calculate the allocation of Task <%s/%s> in Queue <%s>.", + glog.Errorf("Failed to allocate resource for Task <%s/%s> in Queue <%s>, not enough resource.", reclaimee.Namespace, reclaimee.Name, job.Queue) continue } @@ -226,7 +226,7 @@ func (pp *proportionPlugin) OnSessionClose(ssn *framework.Session) { func (pp *proportionPlugin) updateShare(attr *queueAttr) { res := float64(0) - // TODO(k82cn): how to handle fragement issues? + // TODO(k82cn): how to handle fragment issues? for _, rn := range api.ResourceNames() { share := helpers.Share(attr.allocated.Get(rn), attr.deserved.Get(rn)) if share > res {