Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ray-operator/controllers/ray/rayjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func (r *RayJobReconciler) Reconcile(ctx context.Context, request ctrl.Request)

rayDashboardClient, err := r.dashboardClientFunc(rayClusterInstance, rayJobInstance.Status.DashboardURL)
if err != nil {
logger.Error(err, "Failed to get dashboard client for RayJob")
return ctrl.Result{RequeueAfter: RayJobDefaultRequeueDuration}, err
}
if err := rayDashboardClient.StopJob(ctx, rayJobInstance.Status.JobId); err != nil {
Expand Down Expand Up @@ -263,7 +262,6 @@ func (r *RayJobReconciler) Reconcile(ctx context.Context, request ctrl.Request)
// Check the current status of ray jobs
rayDashboardClient, err := r.dashboardClientFunc(rayClusterInstance, rayJobInstance.Status.DashboardURL)
if err != nil {
logger.Error(err, "Failed to get dashboard client for RayJob")
return ctrl.Result{RequeueAfter: RayJobDefaultRequeueDuration}, err
}

Expand Down
3 changes: 3 additions & 0 deletions ray-operator/controllers/ray/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,13 @@ func GetRayDashboardClientFunc(mgr manager.Manager, useKubernetesProxy bool) fun
if headSvcName == "" {
headSvcName, err = GenerateHeadServiceName(RayClusterCRD, rayCluster.Spec, rayCluster.Name)
if err != nil {
err = fmt.Errorf("failed to construct Ray dashboard client: %w", err)
return nil, err
}
}
return &RayDashboardClient{
// Use `mgr.GetHTTPClient()` instead of `http.Client{}` so that the client has proper authentication
// configured to communicate with the Kubernetes API server.
client: mgr.GetHTTPClient(),
dashboardURL: fmt.Sprintf("%s/api/v1/namespaces/%s/services/%s:dashboard/proxy", mgr.GetConfig().Host, rayCluster.Namespace, headSvcName),
}, nil
Expand Down
Loading