diff --git a/controllers/githubactionrunner_controller.go b/controllers/githubactionrunner_controller.go index 4333f167..8ece1fdf 100644 --- a/controllers/githubactionrunner_controller.go +++ b/controllers/githubactionrunner_controller.go @@ -364,6 +364,13 @@ func (r *GithubActionRunnerReconciler) handleFinalization(ctx context.Context, c if err := r.unregisterRunner(ctx, cr, item); err != nil { return err } + if isEvicted(&item.pod) { + logr.FromContextOrDiscard(ctx).Info("Deleting evicted pod", "podname", item.pod.Name) + err := r.DeleteResourceIfExists(ctx, &item.pod) + if err != nil { + return err + } + } if isCompleted(&item.pod) { logr.FromContextOrDiscard(ctx).Info("Deleting succeeded pod", "podname", item.pod.Name) err := r.DeleteResourceIfExists(ctx, &item.pod)