From 742887f28a6bb7e14a1087b7dcb99a005626afdf Mon Sep 17 00:00:00 2001 From: Patrik Segedy Date: Wed, 13 Mar 2024 17:39:18 +0100 Subject: [PATCH] RHINENG-8852: replace excluded reporters by allowed reporters --- conf/listener.env | 2 +- deploy/clowdapp.yaml | 4 ++-- listener/listener.go | 4 ++-- listener/upload.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/listener.env b/conf/listener.env index f6f3cbc05..c049018d9 100644 --- a/conf/listener.env +++ b/conf/listener.env @@ -5,5 +5,5 @@ DB_PASSWD=listener ENABLE_BYPASS=false -EXCLUDED_REPORTERS=yupana +ALLOWED_REPORTERS=puptoo,rhsm-system-profile-bridge EXCLUDED_HOST_TYPES=edge diff --git a/deploy/clowdapp.yaml b/deploy/clowdapp.yaml index c5cdfcb57..7a849c7d5 100644 --- a/deploy/clowdapp.yaml +++ b/deploy/clowdapp.yaml @@ -170,7 +170,7 @@ objects: - {name: PAYLOAD_TRACKER_TOPIC, value: platform.payload-status} - {name: CONSUMER_COUNT, value: '${CONSUMER_COUNT_LISTENER}'} - {name: ENABLE_BYPASS, value: '${ENABLE_BYPASS_LISTENER}'} - - {name: EXCLUDED_REPORTERS, value: '${EXCLUDED_REPORTERS}'} + - {name: ALLOWED_REPORTERS, value: '${ALLOWED_REPORTERS}'} - {name: EXCLUDED_HOST_TYPES, value: '${EXCLUDED_HOST_TYPES}'} - {name: ENABLE_PAYLOAD_TRACKER, value: '${ENABLE_PAYLOAD_TRACKER}'} - {name: ENABLE_PROFILER, value: '${ENABLE_PROFILER_LISTENER}'} @@ -606,7 +606,7 @@ parameters: - {name: DB_DEBUG_LISTENER, value: 'false'} - {name: CONSUMER_COUNT_LISTENER, value: '8'} - {name: ENABLE_BYPASS_LISTENER, value: 'false'} # Enable only bypass (fake) messages processing -- {name: EXCLUDED_REPORTERS, value: 'yupana,rhsm-conduit,satellite,discovery'} # Comma-separated list of reporters to exclude from processing +- {name: ALLOWED_REPORTERS, value: 'puptoo,rhsm-system-profile-bridge'} # Comma-separated list of reporters to exclude from processing - {name: EXCLUDED_HOST_TYPES, value: 'edge'} # Comma-separated list of host types to exclude from processing - {name: RES_LIMIT_CPU_LISTENER, value: 250m} - {name: RES_LIMIT_MEM_LISTENER, value: 192Mi} diff --git a/listener/listener.go b/listener/listener.go index 9ab455a3c..a53a2e73b 100644 --- a/listener/listener.go +++ b/listener/listener.go @@ -18,7 +18,7 @@ var ( evalWriter mqueue.Writer ptWriter mqueue.Writer validReporters map[string]int - excludedReporters map[string]bool + allowedReporters map[string]bool excludedHostTypes map[string]bool enableBypass bool uploadEvalTimeout time.Duration @@ -37,7 +37,7 @@ func configure() { ptWriter = mqueue.NewKafkaWriterFromEnv(ptTopic) validReporters = loadValidReporters() - excludedReporters = getEnvVarStringsSet("EXCLUDED_REPORTERS") + allowedReporters = getEnvVarStringsSet("ALLOWED_REPORTERS") excludedHostTypes = getEnvVarStringsSet("EXCLUDED_HOST_TYPES") enableBypass = utils.GetBoolEnvOrDefault("ENABLE_BYPASS", false) diff --git a/listener/upload.go b/listener/upload.go index e237ec024..8b5a33be0 100644 --- a/listener/upload.go +++ b/listener/upload.go @@ -124,7 +124,7 @@ func HandleUpload(event HostEvent) error { Status: "received", } - if _, ok := excludedReporters[event.Host.Reporter]; ok { + if _, ok := allowedReporters[event.Host.Reporter]; !ok { utils.LogWarn("inventoryID", event.Host.ID, "reporter", event.Host.Reporter, WarnSkippingReporter) messagesReceivedCnt.WithLabelValues(EventUpload, ReceivedWarnExcludedReporter).Inc() utils.ObserveSecondsSince(tStart, messagePartDuration.WithLabelValues("message-skip"))