The --max-workers flag does not align well with the name of the option it configures on the controllers and the new layout. So, we need to deprecate the flag --max-worker and replace it for max-concurrent-reconciles. Also, note the default size should runtime.NumCPU().
Note that we need to update the implementation in cmd/helm|ansible-operator/main.go which is used to generate bin. See: #3331
Example:
// (MaxConcurrentReconciles). Flag `--max-concurrent-reconciles` should be used instead.
pflag.IntVar(&defaultMaxWorkers, "max-workers", runtime.NumCPU(), "Default maximum number of concurrent reconciles for controllers.")
if err := pflag.CommandLine.MarkHidden("max-workers"); err != nil {
setupLog.Error(err, "failed to hide --max-workers flag")
os.Exit(1)
}
....
// Deprecated: --max-workers flag does not align well with the name of the option it configures on the controller
// (MaxConcurrentReconciles). Flag `--max-concurrent-reconciles` should be used instead.
if pflag.Lookup("max-workers").Changed {
setupLog.Info("flag --max-workers has been deprecated, use --max-concurrent-reconciles instead")
if pflag.Lookup("max-concurrent-reconciles").Changed {
setupLog.Info("ignoring --max-workers since --max-concurrent-reconciles is set")
} else {
defaultMaxConcurrentReconciles = defaultMaxWorkers
}
}
...
The
--max-workersflag does not align well with the name of the option it configures on the controllers and the new layout. So, we need to deprecate the flag --max-worker and replace it for max-concurrent-reconciles. Also, note the default size shouldruntime.NumCPU().Note that we need to update the implementation in
cmd/helm|ansible-operator/main.gowhich is used to generate bin. See: #3331Example: