feat: add DiscoveryContextPolicy CRD and discovery context filtering#607
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds Platform context rules for apiextensions.k8s.io, apiregistration.k8s.io, authentication.k8s.io, authorization.k8s.io, and flowcontrol.apiserver.k8s.io. Also moves rbac.authorization.k8s.io resources from Project to Platform. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Restricts notes resources across notes.miloapis.com, crm.miloapis.com, and notification.miloapis.com to the Platform parent context. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…imitives Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…omponent - Moves discovery-context-policy-core.yaml into config/discovery/core/ as a standalone Component, consistent with config/discovery/notes/ - Removes apps, batch, and networking.k8s.io rules (not registered in milo) - Removes serviceaccounts and resourcequotas from core group (explicitly disabled) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes pods, services, persistentvolumeclaims, and limitranges which are not enabled in milo's API server. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kevwilliams
previously approved these changes
May 6, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kevwilliams
approved these changes
May 6, 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.
Summary
DiscoveryContextPolicyCRD (discovery.miloapis.com/v1alpha1) as the highest-precedence source for controlling which API resources appear in discovery responses per parent context (Platform, Organization, Project, User)/apisand/apis/{group}/{version}responses based on the URL prefix of the requestsessionsanduseridentities(identity.miloapis.com) statically as User-context resourcesdiscovery.miloapis.com/parent-contexts=Platformannotation to the namespacedNotetypecore-kubernetes-resourcesDiscoveryContextPolicy covering:How it works
Resources opt in to parent contexts via a CRD annotation (
discovery.miloapis.com/parent-contexts) or aDiscoveryContextPolicyobject (highest precedence). The filter is behind theDiscoveryContextFilteralpha feature gate. Missing or empty annotation means visible everywhere (backwards compatible).Test plan
DiscoveryContextFilterfeature gate enables filteringDiscoveryContextPolicyoverrides CRD annotationstest/discovery-context-filter/passes🤖 Generated with Claude Code