1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-14 11:48:53 +00:00

feat: add aggregation workers flag (#10331)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2024-05-30 08:34:43 +02:00 committed by GitHub
parent 12f70aa0a0
commit e70808ada4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,6 +54,7 @@ func createReportControllers(
aggregateReports bool, aggregateReports bool,
policyReports bool, policyReports bool,
validatingAdmissionPolicyReports bool, validatingAdmissionPolicyReports bool,
aggregationWorkers int,
backgroundScanWorkers int, backgroundScanWorkers int,
client dclient.Interface, client dclient.Interface,
kyvernoClient versioned.Interface, kyvernoClient versioned.Interface,
@ -102,7 +103,7 @@ func createReportControllers(
kyvernoV1.ClusterPolicies(), kyvernoV1.ClusterPolicies(),
vapInformer, vapInformer,
), ),
aggregatereportcontroller.Workers, aggregationWorkers,
)) ))
} }
if backgroundScan { if backgroundScan {
@ -148,6 +149,7 @@ func createrLeaderControllers(
aggregateReports bool, aggregateReports bool,
policyReports bool, policyReports bool,
validatingAdmissionPolicyReports bool, validatingAdmissionPolicyReports bool,
aggregationWorkers int,
backgroundScanWorkers int, backgroundScanWorkers int,
kubeInformer kubeinformers.SharedInformerFactory, kubeInformer kubeinformers.SharedInformerFactory,
kyvernoInformer kyvernoinformer.SharedInformerFactory, kyvernoInformer kyvernoinformer.SharedInformerFactory,
@ -166,6 +168,7 @@ func createrLeaderControllers(
aggregateReports, aggregateReports,
policyReports, policyReports,
validatingAdmissionPolicyReports, validatingAdmissionPolicyReports,
aggregationWorkers,
backgroundScanWorkers, backgroundScanWorkers,
dynamicClient, dynamicClient,
kyvernoClient, kyvernoClient,
@ -190,6 +193,7 @@ func main() {
reportsChunkSize int reportsChunkSize int
backgroundScanWorkers int backgroundScanWorkers int
backgroundScanInterval time.Duration backgroundScanInterval time.Duration
aggregationWorkers int
maxQueuedEvents int maxQueuedEvents int
omitEvents string omitEvents string
skipResourceFilters bool skipResourceFilters bool
@ -202,6 +206,7 @@ func main() {
flagset.BoolVar(&policyReports, "policyReports", true, "Enable or disable policy reports.") flagset.BoolVar(&policyReports, "policyReports", true, "Enable or disable policy reports.")
flagset.BoolVar(&validatingAdmissionPolicyReports, "validatingAdmissionPolicyReports", false, "Enable or disable validating admission policy reports.") flagset.BoolVar(&validatingAdmissionPolicyReports, "validatingAdmissionPolicyReports", false, "Enable or disable validating admission policy reports.")
flagset.IntVar(&reportsChunkSize, "reportsChunkSize", 0, "Max number of results in generated reports, reports will be split accordingly if there are more results to be stored.") flagset.IntVar(&reportsChunkSize, "reportsChunkSize", 0, "Max number of results in generated reports, reports will be split accordingly if there are more results to be stored.")
flagset.IntVar(&aggregationWorkers, "aggregationWorkers", aggregatereportcontroller.Workers, "Configure the number of ephemeral reports aggregation workers.")
flagset.IntVar(&backgroundScanWorkers, "backgroundScanWorkers", backgroundscancontroller.Workers, "Configure the number of background scan workers.") flagset.IntVar(&backgroundScanWorkers, "backgroundScanWorkers", backgroundscancontroller.Workers, "Configure the number of background scan workers.")
flagset.DurationVar(&backgroundScanInterval, "backgroundScanInterval", time.Hour, "Configure background scan interval.") flagset.DurationVar(&backgroundScanInterval, "backgroundScanInterval", time.Hour, "Configure background scan interval.")
flagset.IntVar(&maxQueuedEvents, "maxQueuedEvents", 1000, "Maximum events to be queued.") flagset.IntVar(&maxQueuedEvents, "maxQueuedEvents", 1000, "Maximum events to be queued.")
@ -333,6 +338,7 @@ func main() {
aggregateReports, aggregateReports,
policyReports, policyReports,
validatingAdmissionPolicyReports, validatingAdmissionPolicyReports,
aggregationWorkers,
backgroundScanWorkers, backgroundScanWorkers,
kubeInformer, kubeInformer,
kyvernoInformer, kyvernoInformer,