Skip to content

Commit 252453e

Browse files
author
Anton
authored
CLOUDP-82593: lower sync period (#179)
1 parent 808a0c7 commit 252453e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"flag"
2121
"log"
2222
"os"
23+
"time"
2324

2425
"github.com/go-logr/zapr"
2526
"go.uber.org/zap"
@@ -63,6 +64,7 @@ func main() {
6364
config := parseConfiguration(logger.Sugar())
6465
ctrl.SetLogger(zapr.NewLogger(logger))
6566

67+
syncPeriod := time.Hour * 3
6668
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
6769
Scheme: scheme,
6870
MetricsBindAddress: config.MetricsAddr,
@@ -71,6 +73,7 @@ func main() {
7173
LeaderElection: config.EnableLeaderElection,
7274
LeaderElectionID: "06d035fb.mongodb.com",
7375
Namespace: config.WatchedNamespaces,
76+
SyncPeriod: &syncPeriod,
7477
})
7578
if err != nil {
7679
setupLog.Error(err, "unable to start manager")

test/int/integration_suite_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"os"
2424
"path/filepath"
2525
"testing"
26+
"time"
2627

2728
"github.com/go-logr/zapr"
2829
. "github.com/onsi/ginkgo"
@@ -172,10 +173,14 @@ func prepareControllers() {
172173

173174
ctrl.SetLogger(zapr.NewLogger(logger))
174175

176+
// Note on the syncPeriod - decreasing this to a smaller time allows to test its work for the long-running tests
177+
// (clusters, database users). The prod value is much higher
178+
syncPeriod := time.Minute * 30
175179
k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
176180
Scheme: scheme.Scheme,
177181
Namespace: namespace.Name,
178182
MetricsBindAddress: "0",
183+
SyncPeriod: &syncPeriod,
179184
})
180185
Expect(err).ToNot(HaveOccurred())
181186

0 commit comments

Comments
 (0)