Skip to content

Commit

Permalink
Address comment: Prevent cache empty serveConfig
Browse files Browse the repository at this point in the history
Closes: #2550
Signed-off-by: Chi-Sheng Liu <[email protected]>
  • Loading branch information
MortalHappiness committed Dec 3, 2024
1 parent 1a24e32 commit 040d475
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ray-operator/controllers/ray/rayservice_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -970,13 +970,17 @@ func (r *RayServiceReconciler) getServeConfigFromCache(rayServiceInstance *rayv1
}

func (r *RayServiceReconciler) cacheServeConfig(rayServiceInstance *rayv1.RayService, clusterName string) {
serveConfig := rayServiceInstance.Spec.ServeConfigV2
if serveConfig == "" {
return
}
cacheKey := rayServiceInstance.Namespace + "/" + rayServiceInstance.Name
rayServiceServeConfigs, exist := r.ServeConfigs.Get(cacheKey)
if !exist {
rayServiceServeConfigs = cmap.New[string]()
r.ServeConfigs.Set(cacheKey, rayServiceServeConfigs)
}
rayServiceServeConfigs.Set(clusterName, rayServiceInstance.Spec.ServeConfigV2)
rayServiceServeConfigs.Set(clusterName, serveConfig)
}

func (r *RayServiceReconciler) markRestartAndAddPendingClusterName(ctx context.Context, rayServiceInstance *rayv1.RayService) {
Expand Down

0 comments on commit 040d475

Please sign in to comment.