From 4e912b9a394986fc1596549a4ee808c8e07dd695 Mon Sep 17 00:00:00 2001 From: Kai-Hsun Chen Date: Thu, 29 Aug 2024 22:01:54 -0700 Subject: [PATCH] [RayService] Use original ClusterIP for new head service (#2343) Signed-off-by: kaihsun --- ray-operator/controllers/ray/rayservice_controller.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ray-operator/controllers/ray/rayservice_controller.go b/ray-operator/controllers/ray/rayservice_controller.go index 4cc1ed5924..9a66a0a5c3 100644 --- a/ray-operator/controllers/ray/rayservice_controller.go +++ b/ray-operator/controllers/ray/rayservice_controller.go @@ -989,9 +989,7 @@ func (r *RayServiceReconciler) reconcileServices(ctx context.Context, rayService // ClusterIP is immutable. Starting from Kubernetes v1.21.5, if the new service does not specify a ClusterIP, // Kubernetes will assign the ClusterIP of the old service to the new one. However, to maintain compatibility // with older versions of Kubernetes, we need to assign the ClusterIP here. - if newSvc.Spec.ClusterIP == "" { - newSvc.Spec.ClusterIP = oldSvc.Spec.ClusterIP - } + newSvc.Spec.ClusterIP = oldSvc.Spec.ClusterIP // TODO (kevin85421): Consider not only the updates of the Spec but also the ObjectMeta. oldSvc.Spec = *newSvc.Spec.DeepCopy()