mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
feat: add flag to configure the number of background scan workers (#5088)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: Prateek Pandey <prateek.pandey@nirmata.com>
This commit is contained in:
parent
2078f0dfd2
commit
0d50b70134
2 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
## v1.8.1-rc3
|
||||||
|
|
||||||
|
### Note
|
||||||
|
|
||||||
|
- A new flag `backgroundScanWorkers` to configure the number of background scan workers (default value is `2`).
|
||||||
|
|
||||||
## v1.8.0-rc3
|
## v1.8.0-rc3
|
||||||
|
|
||||||
### Note
|
### Note
|
||||||
|
|
|
@ -93,6 +93,7 @@ var (
|
||||||
backgroundScan bool
|
backgroundScan bool
|
||||||
admissionReports bool
|
admissionReports bool
|
||||||
reportsChunkSize int
|
reportsChunkSize int
|
||||||
|
backgroundScanWorkers int
|
||||||
logFormat string
|
logFormat string
|
||||||
// DEPRECATED: remove in 1.9
|
// DEPRECATED: remove in 1.9
|
||||||
splitPolicyReport bool
|
splitPolicyReport bool
|
||||||
|
@ -126,6 +127,7 @@ func parseFlags() error {
|
||||||
flag.BoolVar(&backgroundScan, "backgroundScan", true, "Enable or disable backgound scan.")
|
flag.BoolVar(&backgroundScan, "backgroundScan", true, "Enable or disable backgound scan.")
|
||||||
flag.BoolVar(&admissionReports, "admissionReports", true, "Enable or disable admission reports.")
|
flag.BoolVar(&admissionReports, "admissionReports", true, "Enable or disable admission reports.")
|
||||||
flag.IntVar(&reportsChunkSize, "reportsChunkSize", 1000, "Max number of results in generated reports, reports will be split accordingly if there are more results to be stored.")
|
flag.IntVar(&reportsChunkSize, "reportsChunkSize", 1000, "Max number of results in generated reports, reports will be split accordingly if there are more results to be stored.")
|
||||||
|
flag.IntVar(&backgroundScanWorkers, "backgroundScanWorkers", backgroundscancontroller.Workers, "Configure the number of background scan workers.")
|
||||||
// DEPRECATED: remove in 1.9
|
// DEPRECATED: remove in 1.9
|
||||||
flag.BoolVar(&splitPolicyReport, "splitPolicyReport", false, "This is deprecated, please don't use it, will be removed in v1.9.")
|
flag.BoolVar(&splitPolicyReport, "splitPolicyReport", false, "This is deprecated, please don't use it, will be removed in v1.9.")
|
||||||
if err := flag.Set("v", "2"); err != nil {
|
if err := flag.Set("v", "2"); err != nil {
|
||||||
|
@ -410,7 +412,7 @@ func createReportControllers(
|
||||||
kubeInformer.Core().V1().Namespaces(),
|
kubeInformer.Core().V1().Namespaces(),
|
||||||
resourceReportController,
|
resourceReportController,
|
||||||
),
|
),
|
||||||
backgroundscancontroller.Workers,
|
backgroundScanWorkers,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue