Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 9039fa7

Browse files
authored
Merge pull request #182 from cpanato/add-sync
manager: add option to configure the sync time
2 parents 28df953 + 89cd3b4 commit 9039fa7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"errors"
2020
"flag"
2121
"os"
22+
"time"
2223

2324
"k8s.io/apimachinery/pkg/runtime"
2425
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
@@ -56,6 +57,7 @@ func main() {
5657
healthAddr string
5758
metricsAddr string
5859
webhookPort int
60+
syncPeriod time.Duration
5961
)
6062

6163
flag.BoolVar(&enableLeaderElection, "enable-leader-election", false,
@@ -77,6 +79,12 @@ func main() {
7779

7880
flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
7981

82+
flag.DurationVar(&syncPeriod,
83+
"sync-period",
84+
10*time.Minute,
85+
"The minimum interval at which watched resources are reconciled (e.g. 15m)",
86+
)
87+
8088
flag.IntVar(&webhookPort,
8189
"webhook-port",
8290
0,
@@ -101,6 +109,7 @@ func main() {
101109
LeaderElection: enableLeaderElection,
102110
LeaderElectionID: "controller-leader-election-capp",
103111
LeaderElectionNamespace: leaderElectionNamespace,
112+
SyncPeriod: &syncPeriod,
104113
HealthProbeBindAddress: healthAddr,
105114
})
106115
if err != nil {

0 commit comments

Comments
 (0)