diff --git a/pkg/apis/mindspore/helper/helper.go b/pkg/apis/mindspore/helper/helper.go index 59118b06d2649db7438aedff8f5c2390f6a3feba..ac745176945e26e1b675a37d1f480a011b9a13d6 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 8983ab2dd1a9fba4957c3dea09cf7c772dbdc1d8..235bd29d6818dd4ea7388dcae7f728acfca21e8d 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 528879c07612043c005505e61b2711f7e7280ca6..74d1ea2cef1f8e02448da826e0f2dae21961ca9d 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() }