Skip to content

Commit

Permalink
bugfix: label selectors for raycluster and MPI
Browse files Browse the repository at this point in the history
  • Loading branch information
Kavinraja-G committed Aug 9, 2024
1 parent 888a14f commit dcd5bc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/jobs/mpijob/mpijob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (j *MPIJob) GVK() schema.GroupVersionKind {
}

func (j *MPIJob) PodLabelSelector() string {
return fmt.Sprintf("%s=%s", kubeflow.JobNameLabel, j.Labels[kubeflow.JobNameLabel])
return fmt.Sprintf("%s=%s", kubeflow.JobNameLabel, j.Name)
}

func (j *MPIJob) PodSets() []kueue.PodSet {
Expand Down
5 changes: 2 additions & 3 deletions pkg/controller/jobs/rayjob/rayjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import (
"fmt"
"strings"

batchv1 "k8s.io/api/batch/v1"

rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
rayutils "github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -93,7 +92,7 @@ func (j *RayJob) GVK() schema.GroupVersionKind {

func (j *RayJob) PodLabelSelector() string {
if j.Status.RayClusterName != "" {
return fmt.Sprintf("%s=%s", batchv1.JobNameLabel, j.Name)
return fmt.Sprintf("%s=%s", rayutils.RayClusterLabelKey, j.Status.RayClusterName)
}
return ""
}
Expand Down

0 comments on commit dcd5bc8

Please sign in to comment.