Skip to content

Commit

Permalink
Registration tokens can become stale. (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkarlsen committed Apr 6, 2021
1 parent b9bf07a commit 5d83b94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/githubactionrunner_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5d83b94

Please sign in to comment.