From 210c5378f7907b1c98740ba7e6145f0327fd7eec Mon Sep 17 00:00:00 2001 From: Lukas Hybner Date: Tue, 19 Oct 2021 14:53:22 +0200 Subject: [PATCH] fix after review Signed-off-by: Lukas Hybner --- controllers/githubactionrunner_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/githubactionrunner_controller.go b/controllers/githubactionrunner_controller.go index 44e73157..1306da33 100644 --- a/controllers/githubactionrunner_controller.go +++ b/controllers/githubactionrunner_controller.go @@ -364,8 +364,8 @@ func (r *GithubActionRunnerReconciler) handleFinalization(ctx context.Context, c if err := r.unregisterRunner(ctx, cr, item); err != nil { return err } - if item.pod.Status.Phase == corev1.PodSucceeded { - logr.FromContext(ctx).Info("Deleting pod " + item.pod.Name) + if isCompleted(&item.pod) { + logr.FromContext(ctx).Info("Deleting succeeded pod", "podname", item.pod.Name) err := r.DeleteResourceIfExists(ctx, &item.pod) if err != nil { return err