From 7f8f278727219ae4d70b2f19ac3f521ae3a3d93c Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Fri, 14 Feb 2025 21:20:10 -0500 Subject: [PATCH] [Fix][RayCluster] fix missing pod name in CreatedWorkerPod and FailedToCreateWorkerPod events (#3057) (#3065) Signed-off-by: Rueian Co-authored-by: Rueian --- ray-operator/controllers/ray/raycluster_controller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ray-operator/controllers/ray/raycluster_controller.go b/ray-operator/controllers/ray/raycluster_controller.go index f7c0b7fe4d1..e453360d05b 100644 --- a/ray-operator/controllers/ray/raycluster_controller.go +++ b/ray-operator/controllers/ray/raycluster_controller.go @@ -1081,12 +1081,12 @@ func (r *RayClusterReconciler) createWorkerPod(ctx context.Context, instance ray replica := pod if err := r.Create(ctx, &replica); err != nil { - r.Recorder.Eventf(&instance, corev1.EventTypeWarning, string(utils.FailedToCreateWorkerPod), "Failed to create worker Pod %s/%s, %v", pod.Namespace, pod.Name, err) + r.Recorder.Eventf(&instance, corev1.EventTypeWarning, string(utils.FailedToCreateWorkerPod), "Failed to create worker Pod for the cluster %s/%s, %v", instance.Namespace, instance.Name, err) return err } r.rayClusterScaleExpectation.ExpectScalePod(replica.Namespace, instance.Name, worker.GroupName, replica.Name, expectations.Create) - logger.Info("Created worker Pod for RayCluster", "name", pod.Name) - r.Recorder.Eventf(&instance, corev1.EventTypeNormal, string(utils.CreatedWorkerPod), "Created worker Pod %s/%s", pod.Namespace, pod.Name) + logger.Info("Created worker Pod for RayCluster", "name", replica.Name) + r.Recorder.Eventf(&instance, corev1.EventTypeNormal, string(utils.CreatedWorkerPod), "Created worker Pod %s/%s", replica.Namespace, replica.Name) return nil }