Skip to content

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

Draft
scotwells wants to merge 1 commit intomainfrom
feat/discovery-context-annotations
Draft

feat: add discovery context annotations for project-scoped resources#86
scotwells wants to merge 1 commit 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 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>
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