Skip to content

Commit f8a9e64

Browse files
kevin85421win5923
authored andcommitted
Follow up 3992: Remove logs and add comments (ray-project#4006)
Signed-off-by: kaihsun <[email protected]>
1 parent da9fb90 commit f8a9e64

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ray-operator/controllers/ray/rayjob_controller.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ func (r *RayJobReconciler) Reconcile(ctx context.Context, request ctrl.Request)
117117

118118
rayDashboardClient, err := r.dashboardClientFunc(rayClusterInstance, rayJobInstance.Status.DashboardURL)
119119
if err != nil {
120-
logger.Error(err, "Failed to get dashboard client for RayJob")
121120
return ctrl.Result{RequeueAfter: RayJobDefaultRequeueDuration}, err
122121
}
123122
if err := rayDashboardClient.StopJob(ctx, rayJobInstance.Status.JobId); err != nil {
@@ -263,7 +262,6 @@ func (r *RayJobReconciler) Reconcile(ctx context.Context, request ctrl.Request)
263262
// Check the current status of ray jobs
264263
rayDashboardClient, err := r.dashboardClientFunc(rayClusterInstance, rayJobInstance.Status.DashboardURL)
265264
if err != nil {
266-
logger.Error(err, "Failed to get dashboard client for RayJob")
267265
return ctrl.Result{RequeueAfter: RayJobDefaultRequeueDuration}, err
268266
}
269267

ray-operator/controllers/ray/utils/util.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,10 +765,13 @@ func GetRayDashboardClientFunc(mgr manager.Manager, useKubernetesProxy bool) fun
765765
if headSvcName == "" {
766766
headSvcName, err = GenerateHeadServiceName(RayClusterCRD, rayCluster.Spec, rayCluster.Name)
767767
if err != nil {
768+
err = fmt.Errorf("failed to construct Ray dashboard client: %w", err)
768769
return nil, err
769770
}
770771
}
771772
return &RayDashboardClient{
773+
// Use `mgr.GetHTTPClient()` instead of `http.Client{}` so that the client has proper authentication
774+
// configured to communicate with the Kubernetes API server.
772775
client: mgr.GetHTTPClient(),
773776
dashboardURL: fmt.Sprintf("%s/api/v1/namespaces/%s/services/%s:dashboard/proxy", mgr.GetConfig().Host, rayCluster.Namespace, headSvcName),
774777
}, nil

0 commit comments

Comments
 (0)