From 99afcdb1d29cf1cbc88313ad832ac2874557d745 Mon Sep 17 00:00:00 2001 From: Frank Jogeleit Date: Sat, 28 Sep 2024 13:30:05 +0200 Subject: [PATCH] update tags Signed-off-by: Frank Jogeleit --- charts/policy-reporter/Chart.yaml | 2 +- charts/policy-reporter/README.md | 6 +++--- charts/policy-reporter/values.yaml | 4 ++-- pkg/email/filter.go | 3 ++- pkg/kubernetes/secrets/informer.go | 3 ++- pkg/kubernetes/secrets/informer_test.go | 9 +++++---- pkg/listener/cleanup_test.go | 3 ++- pkg/listener/new_result_test.go | 2 +- pkg/listener/scope_results_test.go | 3 ++- pkg/listener/send_result_test.go | 3 ++- pkg/target/client_test.go | 2 +- pkg/target/collection.go | 4 +++- pkg/target/collection_test.go | 3 ++- pkg/target/factory_test.go | 3 ++- pkg/target/loki/loki.go | 6 ++++-- pkg/target/loki/loki_test.go | 3 ++- 16 files changed, 36 insertions(+), 23 deletions(-) diff --git a/charts/policy-reporter/Chart.yaml b/charts/policy-reporter/Chart.yaml index 0c3219b6..b5bc4b7b 100644 --- a/charts/policy-reporter/Chart.yaml +++ b/charts/policy-reporter/Chart.yaml @@ -5,7 +5,7 @@ description: | It creates Prometheus Metrics and can send rule validation events to different targets like Loki, Elasticsearch, Slack or Discord type: application -version: 3.0.0-beta.17 +version: 3.0.0-beta.18 appVersion: 3.0.0-beta icon: https://github.com/kyverno/kyverno/raw/main/img/logo.png diff --git a/charts/policy-reporter/README.md b/charts/policy-reporter/README.md index a13da6b8..8d89ab27 100644 --- a/charts/policy-reporter/README.md +++ b/charts/policy-reporter/README.md @@ -3,7 +3,7 @@ Policy Reporter watches for PolicyReport Resources. It creates Prometheus Metrics and can send rule validation events to different targets like Loki, Elasticsearch, Slack or Discord -![Version: 3.0.0-beta.17](https://img.shields.io/badge/Version-3.0.0--beta.17-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0-beta](https://img.shields.io/badge/AppVersion-3.0.0--beta-informational?style=flat-square) +![Version: 3.0.0-beta.18](https://img.shields.io/badge/Version-3.0.0--beta.18-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0-beta](https://img.shields.io/badge/AppVersion-3.0.0--beta-informational?style=flat-square) ## Documentation @@ -56,7 +56,7 @@ Check the [Documentation](https://kyverno.github.io/policy-reporter/guide/02-get | image.registry | string | `"ghcr.io"` | | | image.repository | string | `"kyverno/policy-reporter"` | | | image.pullPolicy | string | `"IfNotPresent"` | | -| image.tag | string | `"2d66b8d"` | | +| image.tag | string | `"3047d63"` | | | imagePullSecrets | list | `[]` | | | priorityClassName | string | `""` | | | replicaCount | int | `1` | | @@ -416,7 +416,7 @@ Check the [Documentation](https://kyverno.github.io/policy-reporter/guide/02-get | plugin.kyverno.image.registry | string | `"ghcr.io"` | Image registry | | plugin.kyverno.image.repository | string | `"kyverno/policy-reporter/kyverno-plugin"` | Image repository | | plugin.kyverno.image.pullPolicy | string | `"IfNotPresent"` | Image PullPolicy | -| plugin.kyverno.image.tag | string | `"0.2.0"` | Image tag Defaults to `Chart.AppVersion` if omitted | +| plugin.kyverno.image.tag | string | `"0.2.2"` | Image tag Defaults to `Chart.AppVersion` if omitted | | plugin.kyverno.replicaCount | int | `1` | Deployment replica count | | plugin.kyverno.logging.encoding | string | `"console"` | log encoding possible encodings are console and json | | plugin.kyverno.logging.logLevel | int | `0` | log level default info | diff --git a/charts/policy-reporter/values.yaml b/charts/policy-reporter/values.yaml index 8db9f9ce..ce10d8a2 100644 --- a/charts/policy-reporter/values.yaml +++ b/charts/policy-reporter/values.yaml @@ -11,7 +11,7 @@ image: registry: ghcr.io repository: kyverno/policy-reporter pullPolicy: IfNotPresent - tag: 2d66b8d + tag: 3047d63 imagePullSecrets: [] @@ -1036,7 +1036,7 @@ plugin: pullPolicy: IfNotPresent # -- (string) Image tag # Defaults to `Chart.AppVersion` if omitted - tag: "0.2.0" + tag: "0.2.2" # -- Deployment replica count replicaCount: 1 diff --git a/pkg/email/filter.go b/pkg/email/filter.go index a19c1fba..bbfd9e40 100644 --- a/pkg/email/filter.go +++ b/pkg/email/filter.go @@ -3,9 +3,10 @@ package email import ( "context" + "go.uber.org/zap" + "github.com/kyverno/policy-reporter/pkg/kubernetes/namespaces" "github.com/kyverno/policy-reporter/pkg/validate" - "go.uber.org/zap" ) type Filter struct { diff --git a/pkg/kubernetes/secrets/informer.go b/pkg/kubernetes/secrets/informer.go index 956c1f3d..dacda08e 100644 --- a/pkg/kubernetes/secrets/informer.go +++ b/pkg/kubernetes/secrets/informer.go @@ -5,13 +5,14 @@ import ( "sync" "time" - "github.com/kyverno/policy-reporter/pkg/target" "go.uber.org/zap" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/metadata" "k8s.io/client-go/metadata/metadatainformer" "k8s.io/client-go/tools/cache" + + "github.com/kyverno/policy-reporter/pkg/target" ) type Informer interface { diff --git a/pkg/kubernetes/secrets/informer_test.go b/pkg/kubernetes/secrets/informer_test.go index b56c95b3..c7fd4bc8 100644 --- a/pkg/kubernetes/secrets/informer_test.go +++ b/pkg/kubernetes/secrets/informer_test.go @@ -5,14 +5,15 @@ import ( "time" "github.com/google/uuid" - "github.com/kyverno/policy-reporter/pkg/kubernetes/secrets" - "github.com/kyverno/policy-reporter/pkg/target" - "github.com/kyverno/policy-reporter/pkg/target/factory" - "github.com/kyverno/policy-reporter/pkg/target/webhook" "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" metafake "k8s.io/client-go/metadata/fake" + + "github.com/kyverno/policy-reporter/pkg/kubernetes/secrets" + "github.com/kyverno/policy-reporter/pkg/target" + "github.com/kyverno/policy-reporter/pkg/target/factory" + "github.com/kyverno/policy-reporter/pkg/target/webhook" ) func NewFakeMetaClient() (*metafake.FakeMetadataClient, metafake.MetadataClient) { diff --git a/pkg/listener/cleanup_test.go b/pkg/listener/cleanup_test.go index bd73665e..d2b7656c 100644 --- a/pkg/listener/cleanup_test.go +++ b/pkg/listener/cleanup_test.go @@ -3,10 +3,11 @@ package listener_test import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/kyverno/policy-reporter/pkg/listener" "github.com/kyverno/policy-reporter/pkg/report" "github.com/kyverno/policy-reporter/pkg/target" - "github.com/stretchr/testify/assert" ) func Test_CleanupListener(t *testing.T) { diff --git a/pkg/listener/new_result_test.go b/pkg/listener/new_result_test.go index f89a0fe9..73f8dee9 100644 --- a/pkg/listener/new_result_test.go +++ b/pkg/listener/new_result_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/kyverno/policy-reporter/pkg/cache" @@ -11,7 +12,6 @@ import ( "github.com/kyverno/policy-reporter/pkg/fixtures" "github.com/kyverno/policy-reporter/pkg/listener" "github.com/kyverno/policy-reporter/pkg/report" - "github.com/stretchr/testify/assert" ) func Test_ResultListener(t *testing.T) { diff --git a/pkg/listener/scope_results_test.go b/pkg/listener/scope_results_test.go index 568c58b6..64bc2064 100644 --- a/pkg/listener/scope_results_test.go +++ b/pkg/listener/scope_results_test.go @@ -3,11 +3,12 @@ package listener_test import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/kyverno/policy-reporter/pkg/crd/api/policyreport/v1alpha2" "github.com/kyverno/policy-reporter/pkg/fixtures" "github.com/kyverno/policy-reporter/pkg/listener" "github.com/kyverno/policy-reporter/pkg/target" - "github.com/stretchr/testify/assert" ) func Test_ScopeResultsListener(t *testing.T) { diff --git a/pkg/listener/send_result_test.go b/pkg/listener/send_result_test.go index 565e1b2b..8fe4ddb1 100644 --- a/pkg/listener/send_result_test.go +++ b/pkg/listener/send_result_test.go @@ -4,11 +4,12 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/kyverno/policy-reporter/pkg/crd/api/policyreport/v1alpha2" "github.com/kyverno/policy-reporter/pkg/fixtures" "github.com/kyverno/policy-reporter/pkg/listener" "github.com/kyverno/policy-reporter/pkg/target" - "github.com/stretchr/testify/assert" ) type client struct { diff --git a/pkg/target/client_test.go b/pkg/target/client_test.go index 32a35052..8f90e5fe 100644 --- a/pkg/target/client_test.go +++ b/pkg/target/client_test.go @@ -3,6 +3,7 @@ package target_test import ( "testing" + "github.com/stretchr/testify/assert" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/kyverno/policy-reporter/pkg/crd/api/policyreport/v1alpha2" @@ -10,7 +11,6 @@ import ( "github.com/kyverno/policy-reporter/pkg/report" "github.com/kyverno/policy-reporter/pkg/target" "github.com/kyverno/policy-reporter/pkg/validate" - "github.com/stretchr/testify/assert" ) var preport = &v1alpha2.PolicyReport{ diff --git a/pkg/target/collection.go b/pkg/target/collection.go index f1ad7a54..df0f147e 100644 --- a/pkg/target/collection.go +++ b/pkg/target/collection.go @@ -4,8 +4,9 @@ import ( "context" "sync" - "github.com/kyverno/policy-reporter/pkg/helper" "go.uber.org/zap" + + "github.com/kyverno/policy-reporter/pkg/helper" ) type TargetType = string @@ -95,6 +96,7 @@ func (c *Collection) SingleSendClients() []Client { return c.Type() == SingleSend }) } + func (c *Collection) SyncClients() []Client { return helper.Filter(c.Clients(), func(c Client) bool { return c.Type() == SyncSend diff --git a/pkg/target/collection_test.go b/pkg/target/collection_test.go index 2929aec7..61b2e5e0 100644 --- a/pkg/target/collection_test.go +++ b/pkg/target/collection_test.go @@ -4,11 +4,12 @@ import ( "testing" "github.com/google/uuid" + "github.com/stretchr/testify/assert" + "github.com/kyverno/policy-reporter/pkg/target" "github.com/kyverno/policy-reporter/pkg/target/discord" "github.com/kyverno/policy-reporter/pkg/target/slack" "github.com/kyverno/policy-reporter/pkg/target/webhook" - "github.com/stretchr/testify/assert" ) func TestCollection(t *testing.T) { diff --git a/pkg/target/factory_test.go b/pkg/target/factory_test.go index c1207bc9..9a72e5b2 100644 --- a/pkg/target/factory_test.go +++ b/pkg/target/factory_test.go @@ -3,9 +3,10 @@ package target_test import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/kyverno/policy-reporter/pkg/crd/api/policyreport/v1alpha2" "github.com/kyverno/policy-reporter/pkg/target" - "github.com/stretchr/testify/assert" ) func TestConfig(t *testing.T) { diff --git a/pkg/target/loki/loki.go b/pkg/target/loki/loki.go index 32eea1e0..c2b8d3b6 100644 --- a/pkg/target/loki/loki.go +++ b/pkg/target/loki/loki.go @@ -11,8 +11,10 @@ import ( "github.com/kyverno/policy-reporter/pkg/target/http" ) -var keyReplacer = strings.NewReplacer(".", "_", "]", "", "[", "") -var labelReplacer = strings.NewReplacer("/", "") +var ( + keyReplacer = strings.NewReplacer(".", "_", "]", "", "[", "") + labelReplacer = strings.NewReplacer("/", "") +) // Options to configure the Loki target type Options struct { diff --git a/pkg/target/loki/loki_test.go b/pkg/target/loki/loki_test.go index 1252f457..96b101ba 100644 --- a/pkg/target/loki/loki_test.go +++ b/pkg/target/loki/loki_test.go @@ -7,10 +7,11 @@ import ( "strings" "testing" + "github.com/stretchr/testify/assert" + "github.com/kyverno/policy-reporter/pkg/fixtures" "github.com/kyverno/policy-reporter/pkg/target" "github.com/kyverno/policy-reporter/pkg/target/loki" - "github.com/stretchr/testify/assert" ) type testClient struct {