Skip to content

fix: selector applies to all block matches#66

Merged
leoparente merged 4 commits intodevelopfrom
fix/OBS-802-selector-parser
Feb 26, 2025
Merged

fix: selector applies to all block matches#66
leoparente merged 4 commits intodevelopfrom
fix/OBS-802-selector-parser

Conversation

@leoparente
Copy link
Contributor

@leoparente leoparente commented Feb 25, 2025

This pull request includes changes to the processSelector function in the gitConfigManager and updates to the documentation for the Orb Agent's configuration. The key changes are focused on improving the handling of policy paths and clarifying the documentation.

Improvements to processSelector function:

  • agent/configmgr/git.go: Replaced the list of policy paths with a set to ensure uniqueness, and added logic to convert the set back to a list before returning it. This change ensures that duplicate policy paths are not included in the results. Also ensure that every match applies and not only the first one.

Documentation updates:

  • docs/configs/git.md: Updated the example directory structure to reflect a more organized layout and added a new example for a selector that matches all agents. [1] [2]
  • Clarified the description of the selector section to indicate that an empty selector matches all agents.

@leoparente leoparente self-assigned this Feb 25, 2025
@github-actions
Copy link

github-actions bot commented Feb 25, 2025

Go test coverage

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 1.02s github.com/netboxlabs/orb-agent/agent 0.0% 1 0 0
🟢 PASS 0.25s github.com/netboxlabs/orb-agent/agent/backend 0.0% 0 0 0
🟢 PASS 0.00s github.com/netboxlabs/orb-agent/agent/backend/devicediscovery 0.0% 0 0 0
🟢 PASS 0.00s github.com/netboxlabs/orb-agent/agent/backend/networkdiscovery 0.0% 0 0 0
🟢 PASS 0.00s github.com/netboxlabs/orb-agent/agent/backend/otel 0.0% 0 0 0
🟢 PASS 0.00s github.com/netboxlabs/orb-agent/agent/backend/pktvisor 0.0% 0 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/backend/worker 0.0% 0 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/configmgr 0.0% 0 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/policies 0.0% 0 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/policymgr 0.0% 0 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/version 100.0% 1 0 0

Total coverage: 0.8%

@leoparente leoparente marked this pull request as ready for review February 25, 2025 16:47
@leoparente leoparente changed the title fix: selector applies all block matches fix: selector applies to all block matches Feb 25, 2025
Copy link
Contributor

@rboucher-me rboucher-me left a comment

Choose a reason for hiding this comment

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

Like it!

@leoparente leoparente merged commit 71c3633 into develop Feb 26, 2025
5 checks passed
@leoparente leoparente deleted the fix/OBS-802-selector-parser branch February 26, 2025 14:53
@github-actions
Copy link

github-actions bot commented Mar 7, 2025

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants