From 969ab9c8dc846056feb296d08a5d9b51581b5c68 Mon Sep 17 00:00:00 2001 From: MeenuyD Date: Tue, 27 Feb 2024 22:58:39 +0530 Subject: [PATCH] Remove cortexOrgID from Prometheus scaler Signed-off-by: MeenuyD --- pkg/scalers/prometheus_scaler.go | 5 ----- pkg/scalers/prometheus_scaler_test.go | 2 -- 2 files changed, 7 deletions(-) diff --git a/pkg/scalers/prometheus_scaler.go b/pkg/scalers/prometheus_scaler.go index b46cf271501..027d355e020 100644 --- a/pkg/scalers/prometheus_scaler.go +++ b/pkg/scalers/prometheus_scaler.go @@ -32,7 +32,6 @@ const ( promThreshold = "threshold" promActivationThreshold = "activationThreshold" promNamespace = "namespace" - promCortexScopeOrgID = "cortexOrgID" promCustomHeaders = "customHeaders" ignoreNullValues = "ignoreNullValues" unsafeSsl = "unsafeSsl" @@ -204,10 +203,6 @@ func parsePrometheusMetadata(config *scalersconfig.ScalerConfig) (meta *promethe meta.namespace = val } - if val, ok := config.TriggerMetadata[promCortexScopeOrgID]; ok && val != "" { - return nil, fmt.Errorf("cortexOrgID is deprecated, please use customHeaders instead") - } - if val, ok := config.TriggerMetadata[promCustomHeaders]; ok && val != "" { customHeaders, err := kedautil.ParseStringList(val) if err != nil { diff --git a/pkg/scalers/prometheus_scaler_test.go b/pkg/scalers/prometheus_scaler_test.go index 844920f6d12..ffaa8c1fe6b 100644 --- a/pkg/scalers/prometheus_scaler_test.go +++ b/pkg/scalers/prometheus_scaler_test.go @@ -60,8 +60,6 @@ var testPromMetadata = []parsePrometheusMetadataTestData{ {map[string]string{"serverAddress": "http://localhost:9090", "metricName": "http_requests_total", "threshold": "100", "query": "up", "customHeaders": "key1=value1,key2=value2"}, false}, // customHeaders with wrong format {map[string]string{"serverAddress": "http://localhost:9090", "metricName": "http_requests_total", "threshold": "100", "query": "up", "customHeaders": "key1=value1,key2"}, true}, - // deprecated cortexOrgID - {map[string]string{"serverAddress": "http://localhost:9090", "metricName": "http_requests_total", "threshold": "100", "query": "up", "cortexOrgID": "my-org"}, true}, // queryParameters {map[string]string{"serverAddress": "http://localhost:9090", "metricName": "http_requests_total", "threshold": "100", "query": "up", "queryParameters": "key1=value1,key2=value2"}, false}, // queryParameters with wrong format