Skip to content

Commit

Permalink
[Feature] Warn Users When Updating the RayClusterSpec in RayJob CR (r…
Browse files Browse the repository at this point in the history
  • Loading branch information
Yicheng-Lu-llll authored Dec 29, 2023
1 parent 4ff389b commit fa74914
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ray-operator/controllers/ray/rayjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,12 @@ func (r *RayJobReconciler) getOrCreateRayClusterInstance(ctx context.Context, ra
}
r.Log.Info("Found associated RayCluster for RayJob", "RayJob", rayJobInstance.Name, "RayCluster", rayClusterNamespacedName)

// Verify that RayJob is not in cluster selector mode first to avoid nil pointer dereference error during spec comparison.
// This is checked by ensuring len(rayJobInstance.Spec.ClusterSelector) equals 0.
if len(rayJobInstance.Spec.ClusterSelector) == 0 && !utils.CompareJsonStruct(rayClusterInstance.Spec, *rayJobInstance.Spec.RayClusterSpec) {
r.Log.Info("Disregard changes in RayClusterSpec of RayJob", "RayJob", rayJobInstance.Name)
}

return rayClusterInstance, nil
}

Expand Down

0 comments on commit fa74914

Please sign in to comment.