feat: add discovery context annotations for project-scoped resources#86
Draft
feat: add discovery context annotations for project-scoped resources#86
Conversation
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>
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 compute repository, and the corresponding+kubebuilder:metadata:annotationsmarkers to the Go type definitions.What these annotations do
The Milo API server includes a discovery filter that uses
discovery.miloapis.com/parent-contextsannotations 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 withProjectas 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.comworkloaddeployments.compute.datumapis.comworkloads.compute.datumapis.comChanges
discovery.miloapis.com/parent-contexts: Projecttometadata.annotationsin all three CRD YAML files underconfig/base/crd/bases/// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Project"marker to the root Go types inapi/v1alpha/so the annotation survives futuretask generaterunsTest plan
config/base/crd/bases/DiscoveryContextFilterfeature gate enabled🤖 Generated with Claude Code