Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Add a new event type FailedToDeleteWorkerPodCollection #2680

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -779,7 +779,7 @@ func (r *RayClusterReconciler) reconcilePods(ctx context.Context, instance *rayv
// Delete all workers if worker group is suspended and skip reconcile
if worker.Suspend != nil && *worker.Suspend {
if _, err := r.deleteAllPods(ctx, common.RayClusterGroupPodsAssociationOptions(instance, worker.GroupName)); err != nil {
r.Recorder.Eventf(instance, corev1.EventTypeWarning, string(utils.FailedToDeleteWorkerPod),
r.Recorder.Eventf(instance, corev1.EventTypeWarning, string(utils.FailedToDeleteWorkerPodCollection),
"Failed deleting worker Pods for suspended group %s in RayCluster %s/%s, %v", worker.GroupName, instance.Namespace, instance.Name, err)
return errstd.Join(utils.ErrFailedDeleteWorkerPod, err)
}
Expand Down
14 changes: 8 additions & 6 deletions ray-operator/controllers/ray/utils/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,11 @@ const (
FailedToDeleteHeadPod K8sEventType = "FailedToDeleteHeadPod"

// Worker Pod event list
CreatedWorkerPod K8sEventType = "CreatedWorkerPod"
FailedToCreateWorkerPod K8sEventType = "FailedToCreateWorkerPod"
DeletedWorkerPod K8sEventType = "DeletedWorkerPod"
FailedToDeleteWorkerPod K8sEventType = "FailedToDeleteWorkerPod"
CreatedWorkerPod K8sEventType = "CreatedWorkerPod"
FailedToCreateWorkerPod K8sEventType = "FailedToCreateWorkerPod"
DeletedWorkerPod K8sEventType = "DeletedWorkerPod"
FailedToDeleteWorkerPod K8sEventType = "FailedToDeleteWorkerPod"
FailedToDeleteWorkerPodCollection K8sEventType = "FailedToDeleteWorkerPodCollection"

// Redis Cleanup Job event list
CreatedRedisCleanupJob K8sEventType = "CreatedRedisCleanupJob"
Expand All @@ -271,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
Loading