Skip to content

Commit

Permalink
RHINENG-8852: replace excluded reporters by allowed reporters
Browse files Browse the repository at this point in the history
  • Loading branch information
psegedy committed Mar 14, 2024
1 parent 1bd14c8 commit 742887f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conf/listener.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ DB_PASSWD=listener

ENABLE_BYPASS=false

EXCLUDED_REPORTERS=yupana
ALLOWED_REPORTERS=puptoo,rhsm-system-profile-bridge
EXCLUDED_HOST_TYPES=edge
4 changes: 2 additions & 2 deletions deploy/clowdapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}'}
Expand Down Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions listener/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion listener/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 742887f

Please sign in to comment.