Skip to content

Commit

Permalink
[RayService] Use original ClusterIP for new head service (ray-project…
Browse files Browse the repository at this point in the history
…#2343)

Signed-off-by: kaihsun <[email protected]>
  • Loading branch information
kevin85421 authored Aug 30, 2024
1 parent a69252e commit 4e912b9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ray-operator/controllers/ray/rayservice_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4e912b9

Please sign in to comment.