From 56e58d684dbe8197668d32ef1a6342675c7a0124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Thu, 4 Jul 2024 10:10:16 +0200 Subject: [PATCH] feat: remove reports chunking (#10597) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- CHANGELOG.md | 6 ++++++ charts/kyverno/Chart.yaml | 2 ++ charts/kyverno/README.md | 1 - charts/kyverno/templates/_helpers.tpl | 3 --- .../kyverno/templates/reports-controller/deployment.yaml | 1 - charts/kyverno/values.yaml | 3 --- cmd/reports-controller/main.go | 7 ------- config/install-latest-testing.yaml | 1 - 8 files changed, 8 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1a19a91e..ebff98b697 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v1.13.0 + +### Note + +- Removed deprecated flag `reportsChunkSize`. + ## v1.11.0 ## v1.11.0-rc.1 diff --git a/charts/kyverno/Chart.yaml b/charts/kyverno/Chart.yaml index 5cadccdc77..3d20cb64f1 100644 --- a/charts/kyverno/Chart.yaml +++ b/charts/kyverno/Chart.yaml @@ -37,6 +37,8 @@ annotations: description: Add a key to preserve configmap settings during upgrade - kind: added description: Make admission reports breaker threshold configurable + - kind: removed + description: Deprecated configuration `features.reports.chunkSize` was removed dependencies: - name: grafana version: v0.0.0 diff --git a/charts/kyverno/README.md b/charts/kyverno/README.md index 3592aff4b8..cc4df33b3b 100644 --- a/charts/kyverno/README.md +++ b/charts/kyverno/README.md @@ -345,7 +345,6 @@ The chart values are organised per component. | features.protectManagedResources.enabled | bool | `false` | Enables the feature | | features.registryClient.allowInsecure | bool | `false` | Allow insecure registry | | features.registryClient.credentialHelpers | list | `["default","google","amazon","azure","github"]` | Enable registry client helpers | -| features.reports.chunkSize | int | `0` | Reports chunk size | | features.ttlController.reconciliationInterval | string | `"1m"` | Reconciliation interval for the label based cleanup manager | | features.tuf.enabled | bool | `false` | Enables the feature | | features.tuf.root | string | `nil` | Tuf root | diff --git a/charts/kyverno/templates/_helpers.tpl b/charts/kyverno/templates/_helpers.tpl index 36075edfd8..48803c82e1 100644 --- a/charts/kyverno/templates/_helpers.tpl +++ b/charts/kyverno/templates/_helpers.tpl @@ -70,9 +70,6 @@ {{- with .protectManagedResources -}} {{- $flags = append $flags (print "--protectManagedResources=" .enabled) -}} {{- end -}} -{{- with .reports -}} - {{- $flags = append $flags (print "--reportsChunkSize=" .chunkSize) -}} -{{- end -}} {{- with .registryClient -}} {{- $flags = append $flags (print "--allowInsecureRegistry=" .allowInsecure) -}} {{- $flags = append $flags (print "--registryCredentialHelpers=" (join "," .credentialHelpers)) -}} diff --git a/charts/kyverno/templates/reports-controller/deployment.yaml b/charts/kyverno/templates/reports-controller/deployment.yaml index 18992f042f..935c092834 100644 --- a/charts/kyverno/templates/reports-controller/deployment.yaml +++ b/charts/kyverno/templates/reports-controller/deployment.yaml @@ -126,7 +126,6 @@ spec: "logging" "omitEvents" "policyExceptions" - "reports" "registryClient" "tuf" ) | nindent 12 }} diff --git a/charts/kyverno/values.yaml b/charts/kyverno/values.yaml index ab908e73d5..42f0d0974e 100644 --- a/charts/kyverno/values.yaml +++ b/charts/kyverno/values.yaml @@ -670,9 +670,6 @@ features: - amazon - azure - github - reports: - # -- Reports chunk size - chunkSize: 0 ttlController: # -- Reconciliation interval for the label based cleanup manager reconciliationInterval: 1m diff --git a/cmd/reports-controller/main.go b/cmd/reports-controller/main.go index d292eb0857..47591319a2 100644 --- a/cmd/reports-controller/main.go +++ b/cmd/reports-controller/main.go @@ -190,7 +190,6 @@ func main() { aggregateReports bool policyReports bool validatingAdmissionPolicyReports bool - reportsChunkSize int backgroundScanWorkers int backgroundScanInterval time.Duration aggregationWorkers int @@ -205,7 +204,6 @@ func main() { flagset.BoolVar(&aggregateReports, "aggregateReports", true, "Enable or disable aggregated 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.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.DurationVar(&backgroundScanInterval, "backgroundScanInterval", time.Hour, "Configure background scan interval.") @@ -245,11 +243,6 @@ func main() { // setup ctx, setup, sdown := internal.Setup(appConfig, "kyverno-reports-controller", skipResourceFilters) defer sdown() - // show warnings - if reportsChunkSize != 0 { - logger := setup.Logger.WithName("wanings") - logger.Info("Warning: reportsChunkSize is deprecated and will be removed in 1.13.") - } // THIS IS AN UGLY FIX // ELSE KYAML IS NOT THREAD SAFE kyamlopenapi.Schema() diff --git a/config/install-latest-testing.yaml b/config/install-latest-testing.yaml index 34af439d27..f061435a6a 100644 --- a/config/install-latest-testing.yaml +++ b/config/install-latest-testing.yaml @@ -45289,7 +45289,6 @@ spec: - --v=2 - --omitEvents=PolicyApplied,PolicySkipped - --enablePolicyException=true - - --reportsChunkSize=0 - --allowInsecureRegistry=false - --registryCredentialHelpers=default,google,amazon,azure,github