Skip to content

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

Merged
scotwells merged 1 commit into
mainfrom
feat/discovery-context-annotations
May 1, 2026
Merged

feat: add discovery context annotations for project-scoped resources#86
scotwells merged 1 commit into
mainfrom
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 compute repository, and the corresponding +kubebuilder:metadata:annotations markers to the Go type definitions.

What these annotations do

The Milo API server includes a discovery filter that uses discovery.miloapis.com/parent-contexts annotations on CRD metadata to determine which resources to surface in API discovery responses. When a client queries API discovery within a Project context (e.g., against a project's dedicated control plane), the filter returns only those resources annotated with Project as a parent context.

Without these annotations, compute resources would be invisible in discovery when clients query within a Project context.

Affected CRDs

  • instances.compute.datumapis.com
  • workloaddeployments.compute.datumapis.com
  • workloads.compute.datumapis.com

Changes

  • Added discovery.miloapis.com/parent-contexts: Project to metadata.annotations in all three CRD YAML files under config/base/crd/bases/
  • Added // +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Project" marker to the root Go types in api/v1alpha/ so the annotation survives future task generate runs

Test plan

  • Verify CRD YAML annotations are present in config/base/crd/bases/
  • Apply CRDs to a cluster connected to a Milo API server with the DiscoveryContextFilter feature gate enabled
  • Confirm compute resources appear in API discovery when querying within a Project context
  • Confirm compute resources are absent from discovery when querying outside a Project context (e.g., Platform context only)

🤖 Generated with Claude Code

All compute 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 1, 2026 16:29
@scotwells scotwells marked this pull request as ready for review May 1, 2026 16:29
@scotwells scotwells merged commit 36e379c into main May 1, 2026
10 of 11 checks passed
@scotwells scotwells deleted the feat/discovery-context-annotations branch May 1, 2026 16:31
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