Skip to content

feat: Feature flags configMap pull and prevents pulling non-sumo conf…#4103

Open
dhruv-shah-sumo wants to merge 1 commit intomainfrom
sdhruv/configmap_pull_sumo_only
Open

feat: Feature flags configMap pull and prevents pulling non-sumo conf…#4103
dhruv-shah-sumo wants to merge 1 commit intomainfrom
sdhruv/configmap_pull_sumo_only

Conversation

@dhruv-shah-sumo
Copy link
Collaborator

@dhruv-shah-sumo dhruv-shah-sumo commented Mar 9, 2026

  • Adds feature flag to control reporting of sumologic collection configMaps. Default value is true.
  • Adds filter processor to configMap pipeline in order to limit configmap pull restricted to only sumologic collection configmap.

How to disable this configmap reporting to sumo?

otelevents:
  reportConfigMaps: false

NOTE: This feature does not pull any secret from the user's environment. Only sumologic collection related configmaps are being pulled.

#4102

Checklist

  • Changelog updated or skip changelog label added
  • Documentation updated
  • Template tests added for new features
  • Integration tests added or modified for major features

@dhruv-shah-sumo dhruv-shah-sumo requested a review from a team as a code owner March 9, 2026 21:00
@dhruv-shah-sumo dhruv-shah-sumo force-pushed the sdhruv/configmap_pull_sumo_only branch 3 times, most recently from cd4b2da to 629beb7 Compare March 10, 2026 05:09
…igmaps.

Signed-off-by: Dhruv Shah <dhruv.shah@sumologic.com>
@dhruv-shah-sumo dhruv-shah-sumo force-pushed the sdhruv/configmap_pull_sumo_only branch from 629beb7 to 2221e73 Compare March 10, 2026 05:12
match_type: regexp
record_attributes:
- key: configmap_name
value: ^{{ .Release.Name }}-(sumologic-metrics-collector|sumologic-metrics-targetallocator|sumologic-otelcol-events|sumologic-otelcol-instrumentation|sumologic-otelcol-logs|sumologic-otelcol-logs-collector|sumologic-otelcol-metrics|sumologic-pvc-cleaner|sumologic-traces-gateway|sumologic-traces-sampler)(-[0-9a-zA-Z]+)?$
Copy link
Contributor

@jagan2221 jagan2221 Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex might fail in release name is longer than 13 characters since we have a limit on ReleaseName + chartName to 22 chars.
https://github.com/SumoLogic/sumologic-kubernetes-collection/blob/main/deploy/helm/sumologic/templates/_helpers/_common.tpl#L11
if releaseName = prodKafkaZookeeper
Then prodKafkaZookeeper-sum-metrics-collector will be the metrics pod name.

  1. Since we already have namespace filter in receiver itself, would it be fine just to have something like
    .(metrics-collector|metrics-targetallocator|otelcol-events|otelcol-instrumentation|otelcol-logs|otelcol-logs-collector|otelcol-metrics|pvc-cleaner|traces-gateway|traces-sampler).

  2. Also another alternate approach would be using labels in configmap to determine if configmap belongs to sumologic. We always have label , chart: sumologic as constant.
    https://github.com/SumoLogic/sumologic-kubernetes-collection/blob/main/deploy/helm/sumologic/templates/_helpers/_common.tpl#L316

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Helm chart feature flag to control whether the Events OTel Collector reports (exports) Kubernetes ConfigMaps, and narrows what gets exported to a Sumo Logic–related subset to address forced ConfigMap logging concerns raised in #4102.

Changes:

  • Introduces otelevents.reportConfigMaps (default true) to enable/disable the ConfigMap receiver + pipeline.
  • Adds an OTel transform + filter processor to only export matching Sumo Logic collection ConfigMaps.
  • Updates Helm goldenfiles and chart documentation/changelog to reflect the new option.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
deploy/helm/sumologic/conf/events/otelcol/config.yaml Gates ConfigMap receiver/pipeline behind reportConfigMaps and adds transform+filter processors.
deploy/helm/sumologic/values.yaml Adds the new otelevents.reportConfigMaps value with default true.
deploy/helm/sumologic/README.md Documents the new Helm value in the parameters table.
tests/helm/testdata/goldenfile/events_otc/basic.output.yaml Updates expected rendered config to include new processors for default behavior.
tests/helm/testdata/goldenfile/events_otc/sumologic-mock.output.yaml Updates expected rendered config for mock exporter scenario.
tests/helm/testdata/goldenfile/events_otc/options.input.yaml Adds reportConfigMaps: false test input.
tests/helm/testdata/goldenfile/events_otc/options.output.yaml Updates expected output to remove ConfigMap receiver/pipeline when disabled.
.changelog/4103.added.txt Adds changelog entry for the feature flag and filtering behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 85 to 90
- name: configmaps
# Only pull sumologic configmaps every day
namespaces:
- {{ .Release.Namespace | quote }}
mode: pull
interval: 24h
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The receiver still pulls all ConfigMaps in the release namespace; the filtering happens later in the pipeline, so this comment is misleading. Please update it to reflect that only exporting/reporting is restricted (and if the goal is to truly restrict API pulls, consider using a receiver-level selector if supported).

Copilot uses AI. Check for mistakes.
@@ -0,0 +1 @@
feat: Feature flags configMap pull and prevents pulling non-sumo configmaps. No newline at end of file
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changelog entry says it “prevents pulling non-sumo configmaps”, but the implementation still pulls all ConfigMaps from the namespace and only filters what gets exported/reported. Please adjust the wording to avoid implying receiver-side filtering.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants