-
Notifications
You must be signed in to change notification settings - Fork 24
Discovery of ConfigMaps and Label Selectors #761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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-selectorssupport tok8s-dynamicdata gatherers (validation + propagation into informer list options). - Extended CyberArk snapshot conversion to include
ark/configmapsreadings and addedConfigMapsto 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.
There was a problem hiding this 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.
ConfigMaps Discovery & Label Selectors
Business Value
These enhancements provide users with greater control and flexibility over Kubernetes resource discovery:
Changes
Feature 1: ConfigMap Discovery
Added ConfigMap resource type to the dynamic data gatherer:
configmapsinto the informer-based collection pipelineFeature 2: Label Selectors
Implemented label selectors for all resource types:
conjur.org/name=conjur-connect-configmapis set for ConfigMap resources.How to test locally
go run . agent --one-shot --machine-hub -v 6 --agent-config-file ./examples/machinehub.yaml