From 6c66e1242477cfbe26a4012a840c32dace805a4a Mon Sep 17 00:00:00 2001 From: zhuyaguang Date: Sat, 28 Aug 2021 16:49:58 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A=E4=B8=8D?= =?UTF-8?q?=E8=A7=84=E8=8C=83=202.=E5=87=BD=E6=95=B0=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E4=B8=8D=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/apis/mindspore/helper/helper.go | 2 +- pkg/trainer/replicas.go | 4 ++-- pkg/trainer/training.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/apis/mindspore/helper/helper.go b/pkg/apis/mindspore/helper/helper.go index 59118b0..ac74517 100755 --- a/pkg/apis/mindspore/helper/helper.go +++ b/pkg/apis/mindspore/helper/helper.go @@ -59,7 +59,7 @@ func ConfigureAcceleratorsForMSJobSpec(c *msv1.MSJobSpec, accelerators map[strin lists := []v1.ResourceList{c.Resources.Limits, c.Resources.Requests} for _, resources := range lists { - for name, _ := range resources { + for name:= range resources { if _, ok := accelerators[string(name)]; !ok { continue diff --git a/pkg/trainer/replicas.go b/pkg/trainer/replicas.go index 8983ab2..235bd29 100755 --- a/pkg/trainer/replicas.go +++ b/pkg/trainer/replicas.go @@ -49,7 +49,7 @@ type MSReplicaSet struct { Spec msv1.MSReplicaSpec } -// MSReplicas is an interface for managing a set of replicas. +// MSReplicaSetInterface MSReplicas is an interface for managing a set of replicas. type MSReplicaSetInterface interface { Create() error Delete() error @@ -375,7 +375,7 @@ func (s *MSReplicaSet) GetSingleReplicaStatus(index int32) msv1.ReplicaState { return status } -// Status returns the status of the replica set. +// GetStatus returns the status of the replica set. func (s *MSReplicaSet) GetStatus() (msv1.MSReplicaStatus, error) { status := msv1.MSReplicaStatus{ MSReplicaType: s.Spec.MSReplicaType, diff --git a/pkg/trainer/training.go b/pkg/trainer/training.go index 528879c..74d1ea2 100755 --- a/pkg/trainer/training.go +++ b/pkg/trainer/training.go @@ -291,7 +291,7 @@ func (j *TrainingJob) updateCRDStatus() error { return nil } -// reconcile tries to get the job into the desired state. +// Reconcile tries to get the job into the desired state. func (j *TrainingJob) Reconcile(config *msv1.ControllerConfig) error { if j.job.Status.Phase == msv1.MSJobPhaseNone { // The job hasn't been setup. @@ -398,8 +398,8 @@ func (j *TrainingJob) name() string { return j.job.ObjectMeta.GetName() } -// fullname returns the namespace and name for the job. -func (j *TrainingJob) fullname() string { +// fullName returns the namespace and name for the job. +func (j *TrainingJob) fullName() string { return j.job.ObjectMeta.GetNamespace() + ":" + j.job.ObjectMeta.GetName() } -- Gitee