Skip to content

Commit

Permalink
Fix Master Label for PyTorchJob
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvelich committed Jan 4, 2024
1 parent ab5de23 commit 329b21f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller.v1/pytorch/pytorchjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,10 @@ func (r *PyTorchJobReconciler) SetClusterSpec(job interface{}, podTemplate *core
func (r *PyTorchJobReconciler) IsMasterRole(replicas map[kubeflowv1.ReplicaType]*kubeflowv1.ReplicaSpec,
rtype kubeflowv1.ReplicaType, index int) bool {
if _, ok := replicas[kubeflowv1.PyTorchJobReplicaTypeMaster]; ok {
return string(rtype) == strings.ToLower(string(kubeflowv1.PyTorchJobReplicaTypeMaster))
return rtype == kubeflowv1.PyTorchJobReplicaTypeMaster
}
// else check if it is worker with index 0
return string(rtype) == strings.ToLower(string(kubeflowv1.PyTorchJobReplicaTypeWorker)) && index == 0
return rtype == kubeflowv1.PyTorchJobReplicaTypeWorker && index == 0
}

func (r *PyTorchJobReconciler) GetDefaultContainerName() string {
Expand Down

0 comments on commit 329b21f

Please sign in to comment.