Skip to content

Conversation

@achuchev
Copy link
Contributor

@achuchev achuchev commented Jan 26, 2026

ConfigMaps Discovery & Label Selectors

Business Value

These enhancements provide users with greater control and flexibility over Kubernetes resource discovery:

  • ConfigMap discovery: Discovery of ConfigMap gaining insights into configuration
  • Label Selectors: Apply label selectors to any Kubernetes resource type, such as Pods, Deployments, Secrets, or ConfigMaps. This helps focus on important resources and exclude non-essential ones, reducing unnecessary data collection.

Changes

Feature 1: ConfigMap Discovery

Added ConfigMap resource type to the dynamic data gatherer:

  • Integrated configmaps into the informer-based collection pipeline
  • Added ConfigMaps to the native Kubernetes resources map for optimized handling
  • ConfigMaps now benefit from the same caching and deletion tracking mechanisms as other resources

Feature 2: Label Selectors

Implemented label selectors for all resource types:

  • Users can use label selectors to filter by labels.
  • By default, the conjur.org/name=conjur-connect-configmap is set for ConfigMap resources.

How to test locally

  • Run the agent one-shot using the example MachineHub config:
    • go run . agent --one-shot --machine-hub -v 6 --agent-config-file ./examples/machinehub.yaml

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

This PR expands Kubernetes discovery to include ConfigMaps and adds support for label selectors (in addition to existing field selectors) for dynamic resource listing.

Changes:

  • Added label-selectors support to k8s-dynamic data gatherers (validation + propagation into informer list options).
  • Extended CyberArk snapshot conversion to include ark/configmaps readings and added ConfigMaps to the uploaded snapshot structure.
  • Updated the disco-agent Helm chart to include a ConfigMaps gatherer with a default label selector.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/datagatherer/k8sdynamic/dynamic.go Adds LabelSelectors config, validates/parses it, and applies it to informer list options.
pkg/datagatherer/k8sdynamic/dynamic_test.go Adds validation tests for label/field selectors (and combined cases).
pkg/client/client_cyberark.go Adds default extractor mapping for ark/configmaps into Snapshot.ConfigMaps.
pkg/client/client_cyberark_test.go Updates the default gatherer name list to include ark/configmaps.
pkg/client/client_cyberark_convertdatareadings_test.go Adds tests covering ConfigMaps conversion and multi-resource conversions.
internal/cyberark/dataupload/dataupload.go Extends Snapshot with ConfigMaps field for upload payload.
deploy/charts/disco-agent/templates/configmap.yaml Adds ark/configmaps gatherer entry with a default label-selectors filter.
deploy/charts/disco-agent/tests/snapshot/configmap_test.yaml.snap Updates chart snapshot expectations to include the new ConfigMaps gatherer config.

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

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


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

@achuchev achuchev marked this pull request as ready for review January 26, 2026 13:17
@achuchev achuchev added the test-e2e To signal e2e test job to be run label Jan 27, 2026
@jetstack jetstack deleted a comment from Copilot AI Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-e2e To signal e2e test job to be run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants