feat(discovery): report available content pack versions in metadata - #129
Merged
Conversation
discovery_inventory requires the caller to pin content_pack_version (no 'latest' default), but nothing told the server which versions this agent has. CollectMetadata now lists the linux-inventory-v<N>.yaml versions present in pack_dir, ascending, so the server can pick one instead of hardcoding. Presence means the file exists; signature verification still happens at execution time.
There was a problem hiding this comment.
Code Review
This pull request implements content pack version reporting in the discovery proxy metadata. It scans the configured pack_dir for files matching linux-inventory-v<N>.yaml, extracts and sorts the version numbers, and includes them in the collected metadata. A test suite has also been added to verify this behavior. The review feedback suggests ignoring 'not exist' errors when reading pack_dir to prevent misleading warning logs on fresh installations before content packs are synced.
A configured-but-not-yet-created pack_dir is a normal fresh-install state; warning on every metadata cycle for it is noise.
blue4209211
approved these changes
Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
discovery_inventoryrequires the caller to pincontent_pack_version— there is no "latest" default, by design (packs are locally cached, signature-verified files). But nothing told the server which versions an agent actually has, so a server-side caller would have to hardcode a version and find out at call time whether it exists.CollectMetadatanow includes apack_versionsfield: thelinux-inventory-v<N>.yamlversions present inpack_dir, ascending. This rides the existingdatasource_metadatamessage, which the relay already persists intointegrations.labels, so the server can pick a version to pin instead of guessing. The key is absent when nopack_diris configured — same as an older agent that predates the field. Presence means the file exists; signature verification still happens at execution time, unchanged.Server-side consumer context: nudgebee/nudgebee-enterprise#35881 (discovery datasource registration) and the scan pipeline in nudgebee/nudgebee-enterprise#35822.
Part of #116.
Type of change
How Has This Been Tested?
pack_dirChecklist
make validatepasses (fmt + lint + test)docs/proxy-modules.mdhas no discovery section yet (pre-existing gap, not extended here)