Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add retry count var #252

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ func main() {
var metricsAddr string
var enableLeaderElection bool
var probeAddr string
var retryCount int
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
flag.IntVar(&retryCount, "retry-count", 5, "The number of retries in case of error.")
opts := k8szap.Options{}
opts.BindFlags(flag.CommandLine)
flag.Parse()
Expand Down Expand Up @@ -106,7 +108,7 @@ func main() {
Log: ctrl.Log.WithName("controllers").WithName("PulsarConnection"),
Recorder: mgr.GetEventRecorderFor("pulsarconnection-controller"),
PulsarAdminCreator: admin.NewPulsarAdmin,
Retryer: utils.NewReconcileRetryer(5, utils.NewEventSource(ctrl.Log.WithName("eventSource"))),
Retryer: utils.NewReconcileRetryer(retryCount, utils.NewEventSource(ctrl.Log.WithName("eventSource"))),
}).SetupWithManager(mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "PulsarConnection")
os.Exit(1)
Expand Down
Loading