Skip to content

fix: context-aware API discovery now works with datumctl#570

Merged
scotwells merged 2 commits intomainfrom
fix/discovery-filter-aggregated-kind-detection
Apr 17, 2026
Merged

fix: context-aware API discovery now works with datumctl#570
scotwells merged 2 commits intomainfrom
fix/discovery-filter-aggregated-kind-detection

Conversation

@scotwells
Copy link
Copy Markdown
Contributor

@scotwells scotwells commented Apr 17, 2026

What changed

When you run datumctl api-resources, the list of resources is now correctly filtered based on your current context — so you only see what's relevant to where you are (organization, project, or user).

Why it wasn't working

The previous release (#567) introduced context-aware discovery filtering. It worked correctly when tested via direct HTTP calls, but datumctl api-resources was still showing everything regardless of context.

The root cause: the filter was checking the response Content-Type header to detect the discovery format. In standard Kubernetes, the server echoes back the requested format in Content-Type — but Milo returns plain application/json, so the filter never recognized the format and skipped filtering entirely.

The fix

kubectl always declares the format it wants via the request Accept header. The filter now checks that instead, which is both more reliable and simpler — no dependency on what the server echoes back.

🤖 Generated with Claude Code

The Milo API server returns plain application/json for aggregated
discovery responses instead of the expected media type containing
as=APIGroupDiscoveryList. Fall back to inspecting the response body's
kind field so the filter correctly handles the aggregated path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@joggrbot
Copy link
Copy Markdown
Contributor

joggrbot Bot commented Apr 17, 2026

📝 Documentation Analysis

All docs are up to date! 🎉


✅ Latest commit analyzed: 6ef5237 | Powered by Joggr

Check the request Accept header for as=APIGroupDiscoveryList rather than
the response Content-Type. kubectl always sends this in the Accept header,
but Milo returns plain application/json in the response so checking the
response header was unreliable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scotwells scotwells merged commit 52113de into main Apr 17, 2026
7 checks passed
@scotwells scotwells deleted the fix/discovery-filter-aggregated-kind-detection branch April 17, 2026 20:22
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