diff --git a/klt-cert-manager/main.go b/klt-cert-manager/main.go index 15b352c577..814ca728e0 100644 --- a/klt-cert-manager/main.go +++ b/klt-cert-manager/main.go @@ -36,7 +36,7 @@ func init() { } type envConfig struct { - KLTNamespace string `envconfig:"NAMESPACE" default:"keptn-lifecycle-toolkit-system"` + KeptnNamespace string `envconfig:"NAMESPACE" default:"keptn-lifecycle-toolkit-system"` KLTLabelSelectorKey string `envconfig:"LABEL_SELECTOR_KEY" default:"keptn.sh/inject-cert"` KLTLabelSelectorValue string `envconfig:"LABEL_SELECTOR_VALUE" default:"true"` } @@ -66,7 +66,7 @@ func main() { Scheme: scheme, Cache: cache.Options{ DefaultNamespaces: map[string]cache.Config{ - env.KLTNamespace: {}, + env.KeptnNamespace: {}, }, }, Metrics: metricsserver.Options{ @@ -99,7 +99,7 @@ func main() { Scheme: mgr.GetScheme(), CancelMgrFunc: nil, Log: ctrl.Log.WithName("KeptnWebhookCert Controller"), - Namespace: env.KLTNamespace, + Namespace: env.KeptnNamespace, MatchLabels: map[string]string{ env.KLTLabelSelectorKey: env.KLTLabelSelectorValue, }, diff --git a/lifecycle-operator/controllers/common/helperfunctions_test.go b/lifecycle-operator/controllers/common/helperfunctions_test.go index 4b79b09bea..632413ec91 100644 --- a/lifecycle-operator/controllers/common/helperfunctions_test.go +++ b/lifecycle-operator/controllers/common/helperfunctions_test.go @@ -14,7 +14,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" ) -const KLTNamespace = "keptn" +const KeptnNamespace = "keptn" func Test_GetItemStatus(t *testing.T) { tests := []struct { @@ -404,7 +404,7 @@ func Test_GetTaskDefinition(t *testing.T) { taskDef: &klcv1alpha3.KeptnTaskDefinition{ ObjectMeta: v1.ObjectMeta{ Name: "taskDef", - Namespace: KLTNamespace, + Namespace: KeptnNamespace, }, }, taskDefName: "taskDef", @@ -412,7 +412,7 @@ func Test_GetTaskDefinition(t *testing.T) { out: &klcv1alpha3.KeptnTaskDefinition{ ObjectMeta: v1.ObjectMeta{ Name: "taskDef", - Namespace: KLTNamespace, + Namespace: KeptnNamespace, }, }, wantError: false, @@ -425,7 +425,7 @@ func Test_GetTaskDefinition(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { client := fake.NewClientBuilder().WithObjects(tt.taskDef).Build() - d, err := GetTaskDefinition(client, ctrl.Log.WithName("testytest"), context.TODO(), tt.taskDefName, tt.taskDefNamespace, KLTNamespace) + d, err := GetTaskDefinition(client, ctrl.Log.WithName("testytest"), context.TODO(), tt.taskDefName, tt.taskDefNamespace, KeptnNamespace) if tt.out != nil && d != nil { require.Equal(t, tt.out.Name, d.Name) require.Equal(t, tt.out.Namespace, d.Namespace) @@ -486,7 +486,7 @@ func Test_GetEvaluationDefinition(t *testing.T) { evalDef: &klcv1alpha3.KeptnEvaluationDefinition{ ObjectMeta: v1.ObjectMeta{ Name: "evalDef", - Namespace: KLTNamespace, + Namespace: KeptnNamespace, }, }, evalDefName: "evalDef", @@ -494,7 +494,7 @@ func Test_GetEvaluationDefinition(t *testing.T) { out: &klcv1alpha3.KeptnEvaluationDefinition{ ObjectMeta: v1.ObjectMeta{ Name: "evalDef", - Namespace: KLTNamespace, + Namespace: KeptnNamespace, }, }, wantError: false, @@ -507,7 +507,7 @@ func Test_GetEvaluationDefinition(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { client := fake.NewClientBuilder().WithObjects(tt.evalDef).Build() - d, err := GetEvaluationDefinition(client, ctrl.Log.WithName("testytest"), context.TODO(), tt.evalDefName, tt.evalDefNamespace, KLTNamespace) + d, err := GetEvaluationDefinition(client, ctrl.Log.WithName("testytest"), context.TODO(), tt.evalDefName, tt.evalDefNamespace, KeptnNamespace) if tt.out != nil && d != nil { require.Equal(t, tt.out.Name, d.Name) require.Equal(t, tt.out.Namespace, d.Namespace) diff --git a/lifecycle-operator/controllers/common/providers/keptnmetric/keptnmetric_test.go b/lifecycle-operator/controllers/common/providers/keptnmetric/keptnmetric_test.go index f1b7a36d51..8d6ff6b707 100644 --- a/lifecycle-operator/controllers/common/providers/keptnmetric/keptnmetric_test.go +++ b/lifecycle-operator/controllers/common/providers/keptnmetric/keptnmetric_test.go @@ -14,7 +14,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" ) -const KLTNamespace = "test" +const KeptnNamespace = "test" func Test_keptnmetric(t *testing.T) { tests := []struct { @@ -85,7 +85,7 @@ func Test_keptnmetric(t *testing.T) { kmp := KeptnMetricProvider{ Log: ctrl.Log.WithName("testytest"), K8sClient: client, - DefaultNamespace: KLTNamespace, + DefaultNamespace: KeptnNamespace, } obj := klcv1alpha3.Objective{ @@ -189,14 +189,14 @@ func Test_Getkeptnmetric(t *testing.T) { metric: &metricsapi.KeptnMetric{ ObjectMeta: metav1.ObjectMeta{ Name: "metric", - Namespace: KLTNamespace, + Namespace: KeptnNamespace, }, }, namespace: "my-other-namespace", out: &metricsapi.KeptnMetric{ ObjectMeta: metav1.ObjectMeta{ Name: "metric", - Namespace: KLTNamespace, + Namespace: KeptnNamespace, }, }, wantError: false, @@ -212,7 +212,7 @@ func Test_Getkeptnmetric(t *testing.T) { kmp := KeptnMetricProvider{ Log: ctrl.Log.WithName("testytest"), K8sClient: client, - DefaultNamespace: KLTNamespace, + DefaultNamespace: KeptnNamespace, } m, err := kmp.GetKeptnMetric(context.TODO(), tt.objective, tt.namespace) diff --git a/lifecycle-operator/controllers/common/taskhandler_test.go b/lifecycle-operator/controllers/common/taskhandler_test.go index f926055363..280b61486e 100644 --- a/lifecycle-operator/controllers/common/taskhandler_test.go +++ b/lifecycle-operator/controllers/common/taskhandler_test.go @@ -101,7 +101,7 @@ func TestTaskHandler(t *testing.T) { }, taskDef: &v1alpha3.KeptnTaskDefinition{ ObjectMeta: v1.ObjectMeta{ - Namespace: KLTNamespace, + Namespace: KeptnNamespace, Name: "task-def", }, }, @@ -141,7 +141,7 @@ func TestTaskHandler(t *testing.T) { }, taskDef: &v1alpha3.KeptnTaskDefinition{ ObjectMeta: v1.ObjectMeta{ - Namespace: KLTNamespace, + Namespace: KeptnNamespace, Name: "task-def", }, }, @@ -377,7 +377,7 @@ func TestTaskHandler(t *testing.T) { Client: fake.NewClientBuilder().WithObjects(initObjs...).Build(), Tracer: trace.NewNoopTracerProvider().Tracer("tracer"), Scheme: scheme.Scheme, - DefaultNamespace: KLTNamespace, + DefaultNamespace: KeptnNamespace, } status, summary, err := handler.ReconcileTasks(context.TODO(), context.TODO(), tt.object, tt.createAttr) if len(tt.wantStatus) == len(status) { diff --git a/lifecycle-operator/controllers/lifecycle/keptnevaluation/controller_test.go b/lifecycle-operator/controllers/lifecycle/keptnevaluation/controller_test.go index c57b33efdb..e6ed7357cf 100644 --- a/lifecycle-operator/controllers/lifecycle/keptnevaluation/controller_test.go +++ b/lifecycle-operator/controllers/lifecycle/keptnevaluation/controller_test.go @@ -24,7 +24,7 @@ import ( k8sfake "sigs.k8s.io/controller-runtime/pkg/client/fake" ) -const KltNamespace = "klt-namespace" +const KeptnNamespace = "klt-namespace" func TestKeptnEvaluationReconciler_Reconcile_FailEvaluation(t *testing.T) { @@ -164,7 +164,7 @@ func TestKeptnEvaluationReconciler_Reconcile_SucceedEvaluation(t *testing.T) { require.Equal(t, "value '10' met objective '<11'", updatedEvaluation.Status.EvaluationStatus[metric.Name].Message) } -func TestKeptnEvaluationReconciler_Reconcile_SucceedEvaluation_withDefinitionInDefaultKLTNamespace(t *testing.T) { +func TestKeptnEvaluationReconciler_Reconcile_SucceedEvaluation_withDefinitionInDefaultKeptnNamespace(t *testing.T) { const namespace = "my-namespace" metric := &metricsapi.KeptnMetric{ diff --git a/lifecycle-operator/controllers/lifecycle/keptntask/job_utils_test.go b/lifecycle-operator/controllers/lifecycle/keptntask/job_utils_test.go index 8aae542c85..da11443cd5 100644 --- a/lifecycle-operator/controllers/lifecycle/keptntask/job_utils_test.go +++ b/lifecycle-operator/controllers/lifecycle/keptntask/job_utils_test.go @@ -18,7 +18,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" ) -const KLTNamespace = "mynamespace" +const KeptnNamespace = "mynamespace" func TestKeptnTaskReconciler_createJob(t *testing.T) { namespace := "default" @@ -91,7 +91,7 @@ func TestKeptnTaskReconciler_createJob_withTaskDefInDefaultNamespace(t *testing. taskDefinitionName := "my-task-definition" cm := makeConfigMap(cmName, namespace) - taskDefinition := makeTaskDefinitionWithConfigmapRef(taskDefinitionName, KLTNamespace, cmName) + taskDefinition := makeTaskDefinitionWithConfigmapRef(taskDefinitionName, KeptnNamespace, cmName) fakeClient := fakeclient.NewClient(cm, taskDefinition) @@ -104,7 +104,7 @@ func TestKeptnTaskReconciler_createJob_withTaskDefInDefaultNamespace(t *testing. EventSender: controllercommon.NewK8sSender(record.NewFakeRecorder(100)), Log: ctrl.Log.WithName("task-controller"), Scheme: fakeClient.Scheme(), - Namespace: KLTNamespace, + Namespace: KeptnNamespace, } task := makeTask("my-task", namespace, taskDefinitionName) diff --git a/lifecycle-operator/test/component/appversion/appversion_suite_test.go b/lifecycle-operator/test/component/appversion/appversion_suite_test.go index d7743b40db..57890f37e6 100644 --- a/lifecycle-operator/test/component/appversion/appversion_suite_test.go +++ b/lifecycle-operator/test/component/appversion/appversion_suite_test.go @@ -33,7 +33,7 @@ var ( spanRecorder *sdktest.SpanRecorder ) -const KLTnamespace = "keptnlifecycle" +const KeptnNamespace = "keptnlifecycle" var _ = BeforeSuite(func() { var readyToStart chan struct{} @@ -48,7 +48,7 @@ var _ = BeforeSuite(func() { Meters: common.InitKeptnMeters(), SpanHandler: &telemetry.SpanHandler{}, TracerFactory: &common.TracerFactory{Tracer: tracer}, - Namespace: KLTnamespace, + Namespace: KeptnNamespace, } Eventually(controller.SetupWithManager(k8sManager)).WithTimeout(30 * time.Second).WithPolling(time.Second).Should(Succeed()) close(readyToStart) diff --git a/lifecycle-operator/test/component/evaluation/evaluation_suite_test.go b/lifecycle-operator/test/component/evaluation/evaluation_suite_test.go index 855c25ce7a..cc4c4dd9bb 100644 --- a/lifecycle-operator/test/component/evaluation/evaluation_suite_test.go +++ b/lifecycle-operator/test/component/evaluation/evaluation_suite_test.go @@ -34,7 +34,7 @@ var ( ns *v1.Namespace ) -const KLTnamespace = "keptnlifecycle" +const KeptnNamespace = "keptnlifecycle" var _ = BeforeSuite(func() { var readyToStart chan struct{} @@ -48,11 +48,11 @@ var _ = BeforeSuite(func() { Log: GinkgoLogr, Meters: common.InitKeptnMeters(), TracerFactory: &common.TracerFactory{Tracer: tracer}, - Namespace: KLTnamespace, + Namespace: KeptnNamespace, } Eventually(controller.SetupWithManager(k8sManager)).WithTimeout(30 * time.Second).WithPolling(time.Second).Should(Succeed()) - ns = common.MakeKLTDefaultNamespace(k8sClient, KLTnamespace) + ns = common.MakeKLTDefaultNamespace(k8sClient, KeptnNamespace) close(readyToStart) }) diff --git a/lifecycle-operator/test/component/evaluation/evaluation_test.go b/lifecycle-operator/test/component/evaluation/evaluation_test.go index ee5497b3c3..d94fa2274e 100644 --- a/lifecycle-operator/test/component/evaluation/evaluation_test.go +++ b/lifecycle-operator/test/component/evaluation/evaluation_test.go @@ -111,17 +111,17 @@ var _ = Describe("Evaluation", Ordered, func() { It("KeptnEvaluationController Should succeed, as it finds KeptnEvaluationDefinition in default KLT namespace", func() { By("Create EvaluationDefiniton") - evaluationDefinition = makeEvaluationDefinition(evaluationDefinitionName, KLTnamespace, metricName) + evaluationDefinition = makeEvaluationDefinition(evaluationDefinitionName, KeptnNamespace, metricName) By("Create KeptnMetric") - metric := makeKeptnMetric(metricName, KLTnamespace) + metric := makeKeptnMetric(metricName, KeptnNamespace) By("Update KeptnMetric to have status") metric2 := &metricsapi.KeptnMetric{} err := k8sClient.Get(context.TODO(), types.NamespacedName{ - Namespace: KLTnamespace, + Namespace: KeptnNamespace, Name: metric.Name, }, metric2) Expect(err).To(BeNil()) @@ -138,14 +138,14 @@ var _ = Describe("Evaluation", Ordered, func() { evaluationdef := &klcv1alpha3.KeptnEvaluationDefinition{} Eventually(func(g Gomega) { err := k8sClient.Get(context.TODO(), types.NamespacedName{ - Namespace: KLTnamespace, + Namespace: KeptnNamespace, Name: evaluationDefinitionName, }, evaluationdef) g.Expect(err).To(BeNil()) g.Expect(evaluationdef.Spec.Objectives[0]).To(Equal(klcv1alpha3.Objective{ KeptnMetricRef: klcv1alpha3.KeptnMetricReference{ Name: metricName, - Namespace: KLTnamespace, + Namespace: KeptnNamespace, }, EvaluationTarget: "<10", })) diff --git a/lifecycle-operator/test/component/task/task_suite_test.go b/lifecycle-operator/test/component/task/task_suite_test.go index dbd90eebaf..6778c047b9 100644 --- a/lifecycle-operator/test/component/task/task_suite_test.go +++ b/lifecycle-operator/test/component/task/task_suite_test.go @@ -30,7 +30,7 @@ var ( ctx context.Context ) -const KLTnamespace = "keptnlifecycle" +const KeptnNamespace = "keptnlifecycle" var _ = BeforeSuite(func() { var readyToStart chan struct{} @@ -47,7 +47,7 @@ var _ = BeforeSuite(func() { Log: GinkgoLogr, Meters: common.InitKeptnMeters(), TracerFactory: &common.TracerFactory{Tracer: tracer}, - Namespace: KLTnamespace, + Namespace: KeptnNamespace, } Eventually(controller.SetupWithManager(k8sManager)).WithTimeout(30 * time.Second).WithPolling(time.Second).Should(Succeed()) close(readyToStart) diff --git a/lifecycle-operator/test/component/task/task_test.go b/lifecycle-operator/test/component/task/task_test.go index 8b12a83dc8..e2c009dca8 100644 --- a/lifecycle-operator/test/component/task/task_test.go +++ b/lifecycle-operator/test/component/task/task_test.go @@ -82,13 +82,13 @@ var _ = Describe("Task", Ordered, func() { ns := &v1.Namespace{ ObjectMeta: metav1.ObjectMeta{ - Name: KLTnamespace, + Name: KeptnNamespace, }, } err := k8sClient.Create(context.TODO(), ns) Expect(err).To(BeNil()) - taskDefinition = makeTaskDefinition(taskDefinitionName, KLTnamespace) + taskDefinition = makeTaskDefinition(taskDefinitionName, KeptnNamespace) task = makeTask(name, namespace, taskDefinition.Name) By("Verifying that a job has been created") @@ -135,13 +135,13 @@ var _ = Describe("Task", Ordered, func() { ns := &v1.Namespace{ ObjectMeta: metav1.ObjectMeta{ - Name: KLTnamespace, + Name: KeptnNamespace, }, } err := k8sClient.Create(context.TODO(), ns) Expect(common.IgnoreAlreadyExists(err)).To(BeNil()) - taskDefinition = makeContainerTaskDefinition(taskDefinitionName, KLTnamespace) + taskDefinition = makeContainerTaskDefinition(taskDefinitionName, KeptnNamespace) task = makeTask(name, namespace, taskDefinition.Name) By("Verifying that a job has been created") diff --git a/lifecycle-operator/test/component/workloadinstance/workloadinstance_suite_test.go b/lifecycle-operator/test/component/workloadinstance/workloadinstance_suite_test.go index d4eb7add33..18d5f5da8f 100644 --- a/lifecycle-operator/test/component/workloadinstance/workloadinstance_suite_test.go +++ b/lifecycle-operator/test/component/workloadinstance/workloadinstance_suite_test.go @@ -33,7 +33,7 @@ var ( spanRecorder *sdktest.SpanRecorder ) -const KLTnamespace = "keptnlifecycle" +const KeptnNamespace = "keptnlifecycle" var _ = BeforeSuite(func() { var readyToStart chan struct{} @@ -48,7 +48,7 @@ var _ = BeforeSuite(func() { Meters: common.InitKeptnMeters(), SpanHandler: &telemetry.SpanHandler{}, TracerFactory: &common.TracerFactory{Tracer: tracer}, - Namespace: KLTnamespace, + Namespace: KeptnNamespace, } Eventually(controller.SetupWithManager(k8sManager)).WithTimeout(30 * time.Second).WithPolling(time.Second).Should(Succeed()) close(readyToStart) diff --git a/metrics-operator/cmd/metrics/adapter/adapter.go b/metrics-operator/cmd/metrics/adapter/adapter.go index 3a2106a08d..c7563ba4b5 100644 --- a/metrics-operator/cmd/metrics/adapter/adapter.go +++ b/metrics-operator/cmd/metrics/adapter/adapter.go @@ -26,7 +26,7 @@ var ( type MetricsAdapter struct { basecmd.AdapterBase - KltNamespace string + KeptnNamespace string } // RunAdapter starts the Keptn Metrics adapter to provide KeptnMetrics via the Kubernetes Custom Metrics API. @@ -70,7 +70,7 @@ func (a *MetricsAdapter) makeProviderOrDie(ctx context.Context) provider.CustomM klog.Fatalf("unable to construct dynamic client: %v", err) } - return kmprovider.NewProvider(ctx, client, a.KltNamespace) + return kmprovider.NewProvider(ctx, client, a.KeptnNamespace) } func addFlags() { diff --git a/metrics-operator/cmd/metrics/adapter/provider/provider.go b/metrics-operator/cmd/metrics/adapter/provider/provider.go index e4f47b592a..19ca2ae521 100644 --- a/metrics-operator/cmd/metrics/adapter/provider/provider.go +++ b/metrics-operator/cmd/metrics/adapter/provider/provider.go @@ -32,10 +32,10 @@ var providerInstance *keptnMetricsProvider var providerOnce sync.Once type keptnMetricsProvider struct { - client dynamic.Interface - scheme *runtime.Scheme - logger logr.Logger - KltNamespace string + client dynamic.Interface + scheme *runtime.Scheme + logger logr.Logger + KeptnNamespace string // cache is being populated via the updates received by the provider's dynamic informer // this way, we avoid sending a request to the Kubernetes API each time a custom metric value should be retrieved @@ -54,8 +54,8 @@ func NewProvider(ctx context.Context, client dynamic.Interface, namespace string cache: CustomMetricsCache{ metrics: map[metricKey]CustomMetricValue{}, }, - logger: ctrl.Log.WithName("provider"), - KltNamespace: namespace, + logger: ctrl.Log.WithName("provider"), + KeptnNamespace: namespace, } if err := providerInstance.watchMetrics(ctx); err != nil { diff --git a/metrics-operator/cmd/metrics/adapter/provider/provider_test.go b/metrics-operator/cmd/metrics/adapter/provider/provider_test.go index 98ebaefcef..d3ff7d1713 100644 --- a/metrics-operator/cmd/metrics/adapter/provider/provider_test.go +++ b/metrics-operator/cmd/metrics/adapter/provider/provider_test.go @@ -15,7 +15,7 @@ import ( provider2 "sigs.k8s.io/custom-metrics-apiserver/pkg/provider" ) -const kltNamespace = "my-namespace" +const KeptnNamespace = "my-namespace" func TestProvider(t *testing.T) { metricObj1 := getSampleKeptnMetric("my-metric", map[string]interface{}{}) @@ -26,7 +26,7 @@ func TestProvider(t *testing.T) { scheme := runtime.NewScheme() fakeClient := fake.NewSimpleDynamicClient(scheme, km) - provider := NewProvider(context.TODO(), fakeClient, kltNamespace) + provider := NewProvider(context.TODO(), fakeClient, KeptnNamespace) require.NotNil(t, provider) @@ -43,14 +43,14 @@ func TestProvider(t *testing.T) { "value": "10.0", } km.SetUnstructuredContent(metricObj1) - _, err := fakeClient.Resource(keptnMetricGroupVersionResource).Namespace(kltNamespace).UpdateStatus(context.TODO(), km, metav1.UpdateOptions{}) + _, err := fakeClient.Resource(keptnMetricGroupVersionResource).Namespace(KeptnNamespace).UpdateStatus(context.TODO(), km, metav1.UpdateOptions{}) require.Nil(t, err) // eventually the updated value should be reflected require.Eventually(t, func() bool { metricValue, err := provider.GetMetricByName(context.TODO(), types.NamespacedName{ - Namespace: kltNamespace, + Namespace: KeptnNamespace, Name: "my-metric", }, provider2.CustomMetricInfo{}, nil) @@ -62,7 +62,7 @@ func TestProvider(t *testing.T) { // look for an unknown metric metricValue, err := provider.GetMetricByName(context.TODO(), types.NamespacedName{ - Namespace: kltNamespace, + Namespace: KeptnNamespace, Name: "my-unknown-metric", }, provider2.CustomMetricInfo{}, labels.Set{}.AsSelector()) @@ -72,7 +72,7 @@ func TestProvider(t *testing.T) { // look for metrics based on a label selector metrics, err := provider.GetMetricBySelector( context.TODO(), - kltNamespace, + KeptnNamespace, labels.Set(map[string]string{"app": "frontend"}).AsSelector(), provider2.CustomMetricInfo{}, nil, @@ -86,7 +86,7 @@ func TestProvider(t *testing.T) { km2 := &unstructured.Unstructured{} km2.SetUnstructuredContent(metricObj2) - _, err = fakeClient.Resource(keptnMetricGroupVersionResource).Namespace(kltNamespace).Create(context.TODO(), km2, metav1.CreateOptions{}) + _, err = fakeClient.Resource(keptnMetricGroupVersionResource).Namespace(KeptnNamespace).Create(context.TODO(), km2, metav1.CreateOptions{}) require.Nil(t, err) // wait for the new metric to be registered @@ -99,7 +99,7 @@ func TestProvider(t *testing.T) { // retrieve based on the selector again metrics, err = provider.GetMetricBySelector( context.TODO(), - kltNamespace, + KeptnNamespace, labels.Set(map[string]string{"app": "frontend"}).AsSelector(), provider2.CustomMetricInfo{}, nil, @@ -109,9 +109,9 @@ func TestProvider(t *testing.T) { require.Len(t, metrics.Items, 1) // delete the metrics again - err = fakeClient.Resource(keptnMetricGroupVersionResource).Namespace(kltNamespace).Delete(context.TODO(), "my-metric", metav1.DeleteOptions{}) + err = fakeClient.Resource(keptnMetricGroupVersionResource).Namespace(KeptnNamespace).Delete(context.TODO(), "my-metric", metav1.DeleteOptions{}) require.Nil(t, err) - err = fakeClient.Resource(keptnMetricGroupVersionResource).Namespace(kltNamespace).Delete(context.TODO(), "my-metric-2", metav1.DeleteOptions{}) + err = fakeClient.Resource(keptnMetricGroupVersionResource).Namespace(KeptnNamespace).Delete(context.TODO(), "my-metric-2", metav1.DeleteOptions{}) require.Nil(t, err) // wait for the length of the returned list to be 0 @@ -128,7 +128,7 @@ func getSampleKeptnMetric(metricName string, labels map[string]interface{}) map[ "kind": "KeptnMetric", "metadata": map[string]interface{}{ "name": metricName, - "namespace": kltNamespace, + "namespace": KeptnNamespace, "labels": labels, }, "spec": map[string]interface{}{ diff --git a/metrics-operator/main.go b/metrics-operator/main.go index 9399a6ab24..c280996465 100644 --- a/metrics-operator/main.go +++ b/metrics-operator/main.go @@ -270,7 +270,7 @@ func startCustomMetricsAdapter(namespace string) { ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGTERM) defer cancel() - metricsAdapter := adapter.MetricsAdapter{KltNamespace: namespace} + metricsAdapter := adapter.MetricsAdapter{KeptnNamespace: namespace} metricsAdapter.RunAdapter(ctx) }