From 326d6a1fe8919966d1ddc95083331571de7e41a2 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Sun, 13 Mar 2022 12:16:55 +0000 Subject: [PATCH] Fix the timing of `Marking owner for unregistration completion` log --- controllers/runner_pod_owner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/runner_pod_owner.go b/controllers/runner_pod_owner.go index d34c9372..e594e3fa 100644 --- a/controllers/runner_pod_owner.go +++ b/controllers/runner_pod_owner.go @@ -536,9 +536,9 @@ func collectPodsForOwners(ctx context.Context, c client.Client, log logr.Logger, } } - log.V(2).Info("Marking owner for unregistration completion", "deletionSafe", deletionSafe, "total", res.total) - if deletionSafe == res.total { + log.V(2).Info("Marking owner for unregistration completion", "deletionSafe", deletionSafe, "total", res.total) + if _, ok := getAnnotation(res.owner, AnnotationKeyUnregistrationCompleteTimestamp); !ok { updated := res.owner.withAnnotation(AnnotationKeyUnregistrationCompleteTimestamp, time.Now().Format(time.RFC3339))