feat: Add configurable annotation filtering to list_resources #97
+420
−5
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.
Summary
Implements Phase 1 of the action plan for Issue #89: Metadata Output Getting Truncated. Adds configurable annotation filtering to the
list_resourcestool to prevent truncation issues with large annotations, particularly GPU node annotations.Changes
New Parameters for
list_resourcesinclude_annotations(boolean): Whether to include annotations in output (default: true)exclude_annotation_keys(array): List of annotation keys to exclude with wildcard support (e.g.,nvidia.com/*)include_annotation_keys(array): List of annotation keys to include exclusivelylabel_selector: Added missing parameter to tool schemaImplementation Details
kubectl.kubernetes.io/last-applied-configurationinclude_annotation_keysis specified, it takes precedence over exclude logicTesting
Usage Examples
Exclude GPU annotations to prevent truncation:
{ "resource_type": "clustered", "group": "", "version": "v1", "resource": "nodes", "exclude_annotation_keys": ["nvidia.com/*", "kubectl.kubernetes.io/last-applied-configuration"] }Include only specific annotations:
{ "resource_type": "namespaced", "group": "", "version": "v1", "resource": "pods", "namespace": "default", "include_annotation_keys": ["app", "version"] }Disable annotations completely:
{ "resource_type": "namespaced", "group": "", "version": "v1", "resource": "pods", "namespace": "default", "include_annotations": false }Benefits
Documentation
Fixes #89