From b0ece7b500ede581bd4138db165e70cd59696f2d Mon Sep 17 00:00:00 2001 From: Mario Manno Date: Wed, 8 Jan 2025 17:16:28 +0100 Subject: [PATCH] fixup! Add jitter to the pollingInterval of GitRepos --- internal/cmd/controller/gitops/reconciler/gitjob_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/controller/gitops/reconciler/gitjob_controller.go b/internal/cmd/controller/gitops/reconciler/gitjob_controller.go index 0376c88e3e..41d2457e84 100644 --- a/internal/cmd/controller/gitops/reconciler/gitjob_controller.go +++ b/internal/cmd/controller/gitops/reconciler/gitjob_controller.go @@ -218,7 +218,7 @@ func addJitter(d time.Duration) time.Duration { return d } - return d + time.Duration(rand.Int64N(int64(d)/5)-int64(d)/10) // nolint:gosec // gosec G404 false positive, not used for crypto + return d + time.Duration(rand.Int64N(int64(d)/10)) // nolint:gosec // gosec G404 false positive, not used for crypto } // manageGitJob is responsible for creating, updating and deleting the GitJob and setting the GitRepo's status accordingly