From 3bdee198fd98b382b7180c09acb6582e6561bf21 Mon Sep 17 00:00:00 2001 From: Oleg Kunitsyn <114359669+hiddenmarten@users.noreply.github.com> Date: Tue, 10 Dec 2024 02:14:53 +0100 Subject: [PATCH] fix: Log the correct time until expiration (#101) Fix calculations in log message about resource expiration --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 9b86ffc..a16b437 100644 --- a/main.go +++ b/main.go @@ -169,7 +169,7 @@ func DoReconcile(dynamicClient dynamic.Interface, eventManager *kevent.EventMana // Cool off a tiny bit to avoid hitting the API too often time.Sleep(ThrottleDuration) } else { - log.Printf("[%s/%s] is configured with a TTL of %s, which means it will expire in %s", apiResource.Name, item.GetName(), ttl, time.Until(item.GetCreationTimestamp().Add(ttlInDuration)).Round(time.Second)) + log.Printf("[%s/%s] is configured with a TTL of %s, which means it will expire in %s", apiResource.Name, item.GetName(), ttl, time.Until(getStartTime(item).Add(ttlInDuration)).Round(time.Second)) } } // Cool off a tiny bit to avoid hitting the API too often