Skip to content

Add clean_metadata option to resource tools for stripping verbose metadata#846

Draft
edcdavid wants to merge 1 commit intocontainers:mainfrom
edcdavid:clean-upstream
Draft

Add clean_metadata option to resource tools for stripping verbose metadata#846
edcdavid wants to merge 1 commit intocontainers:mainfrom
edcdavid:clean-upstream

Conversation

@edcdavid
Copy link
Copy Markdown

Introduce a clean_metadata boolean parameter on resources_get and resources_list that strips managedFields, resourceVersion, uid, generation, and the last-applied-configuration annotation from output. This reduces token consumption and lets LLMs focus on the diagnostically relevant spec/status fields.

Refactor MarshalYaml to accept functional options, replacing the previous hard-coded SetManagedFields(nil) with an opt-in WithCleanMetadata() option that performs a more thorough cleanup.

Assisted by: Cursor

…adata

Introduce a clean_metadata boolean parameter on resources_get and
resources_list that strips managedFields, resourceVersion, uid,
generation, and the last-applied-configuration annotation from output.
This reduces token consumption and lets LLMs focus on the
diagnostically relevant spec/status fields.

Refactor MarshalYaml to accept functional options, replacing the
previous hard-coded SetManagedFields(nil) with an opt-in
WithCleanMetadata() option that performs a more thorough cleanup.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant