Skip to content

Commit

Permalink
Fix runner registration timeout (#301)
Browse files Browse the repository at this point in the history
Fixes #300
  • Loading branch information
mumoshu authored Feb 12, 2021
1 parent bbb036e commit addcbfa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/runner_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (r *RunnerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {

registrationTimeout := 10 * time.Minute
currentTime := time.Now()
registrationDidTimeout := pod.CreationTimestamp.Add(registrationTimeout).Sub(currentTime) > 0
registrationDidTimeout := currentTime.Sub(pod.CreationTimestamp.Add(registrationTimeout)) > 0

if !notRegistered && registrationDidTimeout {
log.Info(
Expand Down
2 changes: 1 addition & 1 deletion controllers/runnerreplicaset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (r *RunnerReplicaSetReconciler) Reconcile(req ctrl.Request) (ctrl.Result, e

registrationTimeout := 15 * time.Minute
currentTime := time.Now()
registrationDidTimeout := runner.CreationTimestamp.Add(registrationTimeout).Sub(currentTime) > 0
registrationDidTimeout := currentTime.Sub(runner.CreationTimestamp.Add(registrationTimeout)) > 0

if !notRegistered && registrationDidTimeout {
log.Info(
Expand Down

0 comments on commit addcbfa

Please sign in to comment.