Skip to content

Discovery of ConfigMaps#769

Merged
inteon merged 7 commits intomasterfrom
feature/discovery-configmaps
Feb 4, 2026
Merged

Discovery of ConfigMaps#769
inteon merged 7 commits intomasterfrom
feature/discovery-configmaps

Conversation

@achuchev
Copy link
Contributor

@achuchev achuchev commented Feb 4, 2026

Discovery of ConfigMap gaining insights into configuration.

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

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

Atanas Chuchev added 6 commits February 4, 2026 13:40
- Add ConfigMaps field to CyberArk Snapshot structure
- Add configmaps to kubernetesNativeResources map in k8sdynamic
- Enable efficient SharedIndexInformer for ConfigMap resources
- Register ark/configmaps extractor function in defaultExtractorFunctions
- Add ark/configmaps to list of default dynamic data gatherers
- Add TestConvertDataReadings_ConfigMaps for ConfigMap conversion
- Add TestConvertDataReadings_ServiceAccounts for service account conversion
- Add TestConvertDataReadings_Roles for role conversion
- Add TestConvertDataReadings_MultipleResources for multi-resource scenarios
- Verify deleted resources are properly excluded from snapshots
- Add ark/configmaps data gatherer with conjur.org label selector
- Update Helm chart test snapshots with new ConfigMap configuration
- Add ark/configmaps data gatherer configuration with label selector
- Add empty ConfigMap data entry to example input.json
- Add conjur-connect-configmap.yaml with CyberArk connection configuration
- Update E2E test script to create sample ConfigMap for discovery testing
- ConfigMap includes conjur.org/name label matching default label selector
@achuchev achuchev added the test-e2e To signal e2e test job to be run label Feb 4, 2026
@achuchev achuchev requested a review from Copilot February 4, 2026 11:44
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 adds ConfigMap discovery capabilities to the dynamic data gatherer, allowing the agent to collect and report ConfigMap resources from Kubernetes clusters to the CyberArk Discovery and Context API.

Changes:

  • Added ConfigMap support to the k8s-dynamic data gatherer with native informer integration for improved memory efficiency
  • Integrated ConfigMaps into the data conversion pipeline and snapshot structure
  • Updated deployment configurations, examples, and E2E tests to include ConfigMap collection with label-based filtering

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/datagatherer/k8sdynamic/dynamic.go Registered ConfigMap native informer in kubernetesNativeResources map
internal/cyberark/dataupload/dataupload.go Added ConfigMaps field to Snapshot structure
pkg/client/client_cyberark.go Added extractor function for ark/configmaps data gatherer
pkg/client/client_cyberark_test.go Updated test data gatherer names list to include ark/configmaps
pkg/client/client_cyberark_convertdatareadings_test.go Added comprehensive test coverage for ConfigMap conversion, including deletion handling
examples/machinehub.yaml Added ConfigMap data gatherer configuration with label selector
examples/machinehub/input.json Added empty ConfigMap data reading entry
hack/ark/conjur-connect-configmap.yaml Created sample ConfigMap for E2E testing
hack/ark/test-e2e.sh Updated E2E test to deploy sample ConfigMap
deploy/charts/disco-agent/templates/configmap.yaml Added ConfigMap data gatherer to Helm chart template
deploy/charts/disco-agent/tests/__snapshot__/configmap_test.yaml.snap Updated snapshot tests with ConfigMap configuration

💡 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 11 out of 11 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 February 4, 2026 13:25
@inteon
Copy link
Contributor

inteon commented Feb 4, 2026

Thank you @achuchev LGTM!

I ran the one-shot command locally and outputted to a file, the agent discovered the example configmap in my cluster.

@inteon inteon merged commit b9e1889 into master Feb 4, 2026
10 checks passed
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