Skip to content

feat: add discovery context annotations for project-scoped resources#64

Merged
scotwells merged 2 commits intomainfrom
feat/discovery-context-annotations
May 5, 2026
Merged

feat: add discovery context annotations for project-scoped resources#64
scotwells merged 2 commits intomainfrom
feat/discovery-context-annotations

Conversation

@scotwells
Copy link
Copy Markdown
Contributor

Summary

This PR adds discovery.miloapis.com/parent-contexts: Project annotations to all CRD manifests in the telemetry-services-operator and the corresponding +kubebuilder:metadata:annotations markers to the Go type definitions.

What this does

The discovery.miloapis.com/parent-contexts annotation 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 with parent-contexts: Project are 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 — added discovery.miloapis.com/parent-contexts: Project under metadata.annotations
  • api/v1alpha1/export_policy_types.go — added // +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Project" marker to the ExportPolicy type so the annotation is preserved across future controller-gen runs

Test plan

  • Verify CRD YAML contains the annotation after applying the manifest
  • Run make generate (or equivalent) and confirm the annotation persists in the regenerated CRD YAML
  • Deploy to a Milo-managed cluster and confirm ExportPolicy appears in discovery when querying within a Project context but is filtered out when querying at a higher scope

🤖 Generated with Claude Code

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>
@scotwells scotwells requested review from a team and kevwilliams May 5, 2026 21:54
@scotwells scotwells marked this pull request as ready for review May 5, 2026 21:59
@scotwells scotwells merged commit b387004 into main May 5, 2026
8 checks passed
@scotwells scotwells deleted the feat/discovery-context-annotations branch May 5, 2026 22:08
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.

2 participants