From 5d83b943ed8bba06b5d6277b9929393ed663ed0b Mon Sep 17 00:00:00 2001 From: "David J. M. Karlsen" Date: Tue, 6 Apr 2021 18:28:13 +0200 Subject: [PATCH] Registration tokens can become stale. (#224) --- controllers/githubactionrunner_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/githubactionrunner_controller.go b/controllers/githubactionrunner_controller.go index 1a1402e6..55f011a8 100644 --- a/controllers/githubactionrunner_controller.go +++ b/controllers/githubactionrunner_controller.go @@ -226,7 +226,8 @@ func (r *GithubActionRunnerReconciler) createOrUpdateRegistrationTokenSecret(ctx return err } - expired := time.Unix(epoch, 0).Before(time.Now().Add(-5 * time.Minute)) + // allow for 5 minute clock-skew + expired := time.Now().Add(5 * time.Minute).After(time.Unix(epoch, 0)) if expired { logger.Info("Registration token expired, updating") return r.updateRegistrationToken(ctx, instance, secret)