Skip to content

Commit 46e9272

Browse files
committed
main.go: set default max reconcilers to number of CPUs
1 parent a9bcf84 commit 46e9272

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

example/watches.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
version: v1
33
kind: Nginx
44
chart: ./helm-charts/nginx
5-
maxConcurrentReconciles: 4
6-
reconcilePeriod: 0s
7-
overrideValues:
8-
image.repository: nginx

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ func main() {
7373

7474
pflag.StringVar(&watchesFile, "watches-file", "./watches.yaml", "Path to watches.yaml file.")
7575
pflag.DurationVar(&defaultReconcilePeriod, "reconcile-period", 0, "Default reconcile period for controllers (use 0 to disable periodic reconciliation)")
76-
pflag.IntVar(&defaultMaxConcurrentReconciles, "max-concurrent-reconciles", 1, "Default maximum number of concurrent reconciles for controllers.")
76+
pflag.IntVar(&defaultMaxConcurrentReconciles, "max-concurrent-reconciles", runtime.NumCPU(), "Default maximum number of concurrent reconciles for controllers.")
7777

7878
// Deprecated: --max-workers flag does not align well with the name of the option it configures on the controller
7979
// (MaxConcurrentReconciles). Flag `--max-concurrent-reconciles` should be used instead.
80-
pflag.IntVar(&defaultMaxWorkers, "max-workers", 1, "Default maximum number of concurrent reconciles for controllers.")
80+
pflag.IntVar(&defaultMaxWorkers, "max-workers", runtime.NumCPU(), "Default maximum number of concurrent reconciles for controllers.")
8181
if err := pflag.CommandLine.MarkHidden("max-workers"); err != nil {
8282
setupLog.Error(err, "failed to hide --max-workers flag")
8383
os.Exit(1)

0 commit comments

Comments
 (0)