From 408b6f4c63114b16e9829b0f3eb786477931b2a1 Mon Sep 17 00:00:00 2001 From: QuentinBisson Date: Tue, 17 Dec 2024 17:47:32 +0100 Subject: [PATCH] fix tests --- pkg/common/common.go | 8 -------- pkg/resource/events-logger-config/reconciler.go | 1 + pkg/resource/events-logger-secret/reconciler.go | 1 + .../alloy/test/logging-config.alloy.162_MC.yaml | 4 ---- .../alloy/test/logging-config.alloy.162_WC.yaml | 4 ---- .../alloy/test/logging-config.alloy.170_MC.yaml | 4 ---- .../alloy/test/logging-config.alloy.170_WC.yaml | 4 ---- ...ging-config.alloy.170_WC_default_namespaces_empty.yaml | 4 ---- ...ogging-config.alloy.170_WC_default_namespaces_nil.yaml | 4 ---- 9 files changed, 2 insertions(+), 32 deletions(-) diff --git a/pkg/common/common.go b/pkg/common/common.go index c5526be1..7355a531 100644 --- a/pkg/common/common.go +++ b/pkg/common/common.go @@ -107,11 +107,3 @@ func FormatScrapedNamespaces(lc loggedcluster.Interface, namespaces []string) st return "[]" } - -func FormatScrapedNamespaces(lc loggedcluster.Interface, namespaces []string) string { - if IsWorkloadCluster(lc) { - return fmt.Sprintf("[\"%s\"]", strings.Join(namespaces, "\", \"")) - } - - return "[]" -} diff --git a/pkg/resource/events-logger-config/reconciler.go b/pkg/resource/events-logger-config/reconciler.go index 3c1c8b36..4db3cb19 100644 --- a/pkg/resource/events-logger-config/reconciler.go +++ b/pkg/resource/events-logger-config/reconciler.go @@ -3,6 +3,7 @@ package eventsloggerconfig import ( "context" "reflect" + "github.com/pkg/errors" v1 "k8s.io/api/core/v1" apimachineryerrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/resource/events-logger-secret/reconciler.go b/pkg/resource/events-logger-secret/reconciler.go index 0093f12c..f0a04086 100644 --- a/pkg/resource/events-logger-secret/reconciler.go +++ b/pkg/resource/events-logger-secret/reconciler.go @@ -3,6 +3,7 @@ package eventsloggersecret import ( "context" "reflect" + "github.com/pkg/errors" v1 "k8s.io/api/core/v1" apimachineryerrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/resource/logging-config/alloy/test/logging-config.alloy.162_MC.yaml b/pkg/resource/logging-config/alloy/test/logging-config.alloy.162_MC.yaml index d0fe8f73..2974d347 100644 --- a/pkg/resource/logging-config/alloy/test/logging-config.alloy.162_MC.yaml +++ b/pkg/resource/logging-config/alloy/test/logging-config.alloy.162_MC.yaml @@ -297,10 +297,6 @@ alloy: tls_config { insecure_skip_verify = false } - - tls_config { - insecure_skip_verify = false - } } external_labels = { cluster_id = "test-installation", diff --git a/pkg/resource/logging-config/alloy/test/logging-config.alloy.162_WC.yaml b/pkg/resource/logging-config/alloy/test/logging-config.alloy.162_WC.yaml index c1be9e95..90ac4c0b 100644 --- a/pkg/resource/logging-config/alloy/test/logging-config.alloy.162_WC.yaml +++ b/pkg/resource/logging-config/alloy/test/logging-config.alloy.162_WC.yaml @@ -302,10 +302,6 @@ alloy: tls_config { insecure_skip_verify = false } - - tls_config { - insecure_skip_verify = false - } } external_labels = { cluster_id = "test-cluster", diff --git a/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_MC.yaml b/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_MC.yaml index 3224458c..2e6abe0f 100644 --- a/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_MC.yaml +++ b/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_MC.yaml @@ -291,10 +291,6 @@ alloy: tls_config { insecure_skip_verify = false } - - tls_config { - insecure_skip_verify = false - } } external_labels = { cluster_id = "test-installation", diff --git a/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC.yaml b/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC.yaml index 4b13e434..05b3cfb8 100644 --- a/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC.yaml +++ b/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC.yaml @@ -291,10 +291,6 @@ alloy: tls_config { insecure_skip_verify = false } - - tls_config { - insecure_skip_verify = false - } } external_labels = { cluster_id = "test-cluster", diff --git a/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC_default_namespaces_empty.yaml b/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC_default_namespaces_empty.yaml index d9d31019..2cf9fb27 100644 --- a/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC_default_namespaces_empty.yaml +++ b/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC_default_namespaces_empty.yaml @@ -291,10 +291,6 @@ alloy: tls_config { insecure_skip_verify = false } - - tls_config { - insecure_skip_verify = false - } } external_labels = { cluster_id = "test-cluster", diff --git a/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC_default_namespaces_nil.yaml b/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC_default_namespaces_nil.yaml index d9d31019..2cf9fb27 100644 --- a/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC_default_namespaces_nil.yaml +++ b/pkg/resource/logging-config/alloy/test/logging-config.alloy.170_WC_default_namespaces_nil.yaml @@ -291,10 +291,6 @@ alloy: tls_config { insecure_skip_verify = false } - - tls_config { - insecure_skip_verify = false - } } external_labels = { cluster_id = "test-cluster",