From bd4f5f380197eff9e7963290a2947c4dcd992af1 Mon Sep 17 00:00:00 2001 From: Irena Rindos Date: Thu, 22 Sep 2022 13:13:31 -0400 Subject: [PATCH] update worker auth rotate (#2484) --- internal/daemon/worker/auth_rotation.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/daemon/worker/auth_rotation.go b/internal/daemon/worker/auth_rotation.go index f1270f42c3..6decf0f92a 100644 --- a/internal/daemon/worker/auth_rotation.go +++ b/internal/daemon/worker/auth_rotation.go @@ -93,7 +93,7 @@ func (w *Worker) startAuthRotationTicking(cancelCtx context.Context) { shouldRotate = true default: delta := latestValid.Sub(earliestValid) - shouldRotate = now.Before(earliestValid.Add(delta / 2)) + shouldRotate = now.After(earliestValid.Add(delta / 2)) } if !shouldRotate { @@ -104,6 +104,7 @@ func (w *Worker) startAuthRotationTicking(cancelCtx context.Context) { event.WriteError(cancelCtx, op, err) continue } + event.WriteSysEvent(cancelCtx, op, "worker credentials rotated") // TODO (maybe): Calculate new delta and set a custom retry time on the timer? }