Skip to content

Commit

Permalink
Fix a bug that the failed to inject nodeSelectors to KubeflowJobs
Browse files Browse the repository at this point in the history
Signed-off-by: tenzen-y <[email protected]>
  • Loading branch information
tenzen-y committed Dec 8, 2023
1 parent 0e62f1a commit 0373371
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ func (j *KubeflowJob) RunWithPodSetsInfo(podSetsInfo []podset.PodSetInfo) error
for index := range podSetsInfo {
replicaType := orderedReplicaTypes[index]
info := podSetsInfo[index]
replica := &j.KFJobControl.ReplicaSpecs()[replicaType].Template
if err := podset.Merge(&replica.ObjectMeta, &replica.Spec, info); err != nil {
err := podset.Merge(&j.KFJobControl.ReplicaSpecs()[replicaType].Template.ObjectMeta, &j.KFJobControl.ReplicaSpecs()[replicaType].Template.Spec, info)
if err != nil {
return err
}

}
return nil
}
Expand All @@ -76,8 +75,7 @@ func (j *KubeflowJob) RestorePodSetsInfo(podSetsInfo []podset.PodSetInfo) bool {
changed := false
for index, info := range podSetsInfo {
replicaType := orderedReplicaTypes[index]
replica := &j.KFJobControl.ReplicaSpecs()[replicaType].Template
changed = podset.RestorePodSpec(&replica.ObjectMeta, &replica.Spec, info) || changed
changed = podset.RestorePodSpec(&j.KFJobControl.ReplicaSpecs()[replicaType].Template.ObjectMeta, &j.KFJobControl.ReplicaSpecs()[replicaType].Template.Spec, info) || changed
}
return changed
}
Expand Down

0 comments on commit 0373371

Please sign in to comment.