Skip to content

Commit

Permalink
chore: add FailedToDeletePodCollections and change err msg which rela…
Browse files Browse the repository at this point in the history
…te to r.deleteAllPods
  • Loading branch information
CheyuWu committed Dec 28, 2024
1 parent f8f7989 commit e7d7f94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ray-operator/controllers/ray/raycluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ func (r *RayClusterReconciler) reconcilePods(ctx context.Context, instance *rayv
if suspendStatus == rayv1.RayClusterSuspending ||
(!statusConditionGateEnabled && instance.Spec.Suspend != nil && *instance.Spec.Suspend) {
if _, err := r.deleteAllPods(ctx, common.RayClusterAllPodsAssociationOptions(instance)); err != nil {
r.Recorder.Eventf(instance, corev1.EventTypeWarning, string(utils.FailedToDeletePod),
r.Recorder.Eventf(instance, corev1.EventTypeWarning, string(utils.FailedToDeletePodCollection),
"Failed deleting Pods due to suspension for RayCluster %s/%s, %v",
instance.Namespace, instance.Name, err)
return errstd.Join(utils.ErrFailedDeleteAllPods, err)
Expand Down
5 changes: 3 additions & 2 deletions ray-operator/controllers/ray/utils/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ const (
InvalidRayServiceSpec K8sEventType = "InvalidRayServiceSpec"

// Generic Pod event list
DeletedPod K8sEventType = "DeletedPod"
FailedToDeletePod K8sEventType = "FailedToDeletePod"
DeletedPod K8sEventType = "DeletedPod"
FailedToDeletePod K8sEventType = "FailedToDeletePod"
FailedToDeletePodCollection K8sEventType = "FailedToDeletePodCollection"

// Ingress event list
CreatedIngress K8sEventType = "CreatedIngress"
Expand Down

0 comments on commit e7d7f94

Please sign in to comment.