Skip to content

Commit 5d83b94

Browse files
authored
Registration tokens can become stale. (#224)
1 parent b9bf07a commit 5d83b94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

controllers/githubactionrunner_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ func (r *GithubActionRunnerReconciler) createOrUpdateRegistrationTokenSecret(ctx
226226
return err
227227
}
228228

229-
expired := time.Unix(epoch, 0).Before(time.Now().Add(-5 * time.Minute))
229+
// allow for 5 minute clock-skew
230+
expired := time.Now().Add(5 * time.Minute).After(time.Unix(epoch, 0))
230231
if expired {
231232
logger.Info("Registration token expired, updating")
232233
return r.updateRegistrationToken(ctx, instance, secret)

0 commit comments

Comments
 (0)