feat: add discovery context annotations for project-scoped resources#64
Merged
feat: add discovery context annotations for project-scoped resources#64
Conversation
All telemetry resources are scoped to the Project discovery context. This controls which resources appear in API discovery when querying within a project's control plane. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kevwilliams
approved these changes
May 5, 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
This PR adds
discovery.miloapis.com/parent-contexts: Projectannotations to all CRD manifests in the telemetry-services-operator and the corresponding+kubebuilder:metadata:annotationsmarkers to the Go type definitions.What this does
The
discovery.miloapis.com/parent-contextsannotation tells the Milo API server's discovery filter which resources to surface during API discovery. When a client queries the API within a Project context, only resources annotated withparent-contexts: Projectare included in the discovery response. Resources without this annotation are hidden from project-scoped discovery.Affected CRDs
exportpolicies.telemetry.miloapis.com(ExportPolicy)Changes
config/crd/bases/telemetry.miloapis.com_exportpolicies.yaml— addeddiscovery.miloapis.com/parent-contexts: Projectundermetadata.annotationsapi/v1alpha1/export_policy_types.go— added// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Project"marker to theExportPolicytype so the annotation is preserved across futurecontroller-genrunsTest plan
make generate(or equivalent) and confirm the annotation persists in the regenerated CRD YAMLExportPolicyappears in discovery when querying within a Project context but is filtered out when querying at a higher scope🤖 Generated with Claude Code