-
Notifications
You must be signed in to change notification settings - Fork 611
Closed
Labels
Description
Search before asking
- I had searched in the issues and found no similar feature requirement.
Description
This is one of the tracking items of the REP: RayCluster status improvement, the step 4 in the design doc: https://docs.google.com/document/d/1bRL0cZa87eCX6SI7gqthN68CgmHaB6l3-vJuIse-BrY
We should record the name of the Ray Head Pod in the RayCluster.Status.Head.PodName
field and make the getHeadPod
function retrieve the pod based on the field.
kuberay/ray-operator/controllers/ray/rayservice_controller.go
Lines 1223 to 1235 in a43217b
// TODO: Move this function to util.go and always use this function to retrieve the head Pod. | |
func (r *RayServiceReconciler) getHeadPod(ctx context.Context, instance *rayv1.RayCluster) (*corev1.Pod, error) { | |
podList := corev1.PodList{} | |
if err := r.List(ctx, &podList, common.RayClusterHeadPodsAssociationOptions(instance).ToListOptions()...); err != nil { | |
return nil, err | |
} | |
if len(podList.Items) != 1 { | |
return nil, fmt.Errorf("Found %d head pods for RayCluster %s in the namespace %s", len(podList.Items), instance.Name, instance.Namespace) | |
} | |
return &podList.Items[0], nil | |
} |
Use case
No response
Related issues
Are you willing to submit a PR?
- Yes I am willing to submit a PR!