Conversation
Collaborator
Author
|
This'll be unlocked once #83 merges. |
There was a problem hiding this comment.
Pull request overview
This PR removes the “presence label” workaround previously required to match all resources of a kind via Crossplane required-resources, now relying on Crossplane >= v2.2.1 and crossplane-function-sdk-python v0.14.0 to support bare ResourceSelectors.
Changes:
- Bump
crossplane-function-sdk-pythonto>=0.14.0across the workspace and lockfile. - Update
compose-model-deploymentandcompose-model-cacheto require allInferenceCluster/ModelReplicaresources using bare selectors (no presence labels), and update tests accordingly. - Remove
modelplane.ai/cluster: "true"from example InferenceCluster manifests and declare Crossplane>=v2.2.1incrossplane-project.yaml.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Locks crossplane-function-sdk-python at 0.14.0 and updates dependency constraints. |
| pyproject.toml | Bumps dev dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-serving-stack/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-model-service/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-model-replica/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-model-endpoint/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-model-deployment/tests/test_scheduling.py | Removes modelplane.ai/replica presence label from test fixtures. |
| functions/compose-model-deployment/tests/test_fn.py | Updates required-resource selector expectations and removes presence label from expected replicas. |
| functions/compose-model-deployment/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-model-deployment/function/fn.py | Drops presence label usage; uses bare selectors to match all clusters/replicas. |
| functions/compose-model-cache/tests/test_fn.py | Updates cluster fixtures and selector expectations to no longer require presence labels. |
| functions/compose-model-cache/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-model-cache/function/fn.py | Drops cluster presence-label selector; uses bare selector unless user narrows with clusterSelector. |
| functions/compose-inference-gateway/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-inference-cluster/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-inference-class/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-gke-cluster/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| functions/compose-eks-cluster/pyproject.toml | Bumps function dependency on crossplane-function-sdk-python>=0.14.0. |
| examples/qwen-demo/03-cluster.yaml | Removes the now-unnecessary modelplane.ai/cluster: "true" label from demo clusters. |
| examples/platform/inference-cluster-gke.yaml | Updates guidance comment and removes modelplane.ai/cluster: "true" label. |
| examples/platform/inference-cluster-existing.yaml | Removes modelplane.ai/cluster: "true" label. |
| examples/platform/inference-cluster-eks.yaml | Removes outdated guidance about required presence label and removes the label itself. |
| crossplane-project.yaml | Declares Crossplane >=v2.2.1 and pins CRD dependency ref to v2.3.2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
compose-model-deployment and compose-model-cache need to ask Crossplane for "all InferenceClusters" and "all ModelReplicas". Crossplane's required resources API used to reject a ResourceSelector with neither match_name nor match_labels, so both functions required a presence label on every resource — modelplane.ai/cluster=true on InferenceClusters and modelplane.ai/replica=true on ModelReplicas — and matched on it. The cluster label was the worse of the two: a mandatory label with no semantic meaning that the platform team had to remember on every InferenceCluster, with no signal in the schema that it was required. crossplane/crossplane#7241 fixed the underlying issue in v2.2.1: a ResourceSelector with only apiVersion and kind set now matches all resources of that kind. function-sdk-python v0.14.0 then let require_resources build such a selector when called with neither match field. This bumps the SDK to v0.14.0, drops both presence labels, and matches all InferenceClusters (when no clusterSelector is set) and all ModelReplicas by calling require_resources with no match field. The package declares spec.crossplane.version '>=v2.2.1' so it won't install on a Crossplane without the fix, and the CRD apiDependency moves from the release-2.2 branch to the v2.3.2 tag. The ModelDeployment, ModelCache, and ModelService XRDs declared their matchLabels selectors as bare objects with x-kubernetes-preserve-unknown-fields, which let non-string label values through to the functions as dict[str, Any]. A label selector's values are always strings, so this types them as additionalProperties of type string — matching how the XRDs already declare labels and annotations — and drops the now-redundant str() coercion in compose-model-cache. Fixes #11. Signed-off-by: Nic Cope <nicc@rk0n.org>
dennis-upbound
approved these changes
Jun 11, 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.
Description of your changes
Fixes #11.
compose-model-deployment and compose-model-cache need to ask Crossplane for "all InferenceClusters" and "all ModelReplicas". Crossplane's required resources API used to reject a
ResourceSelectorwith neithermatch_namenormatch_labels, so both functions required a presence label on every resource —modelplane.ai/cluster=trueon InferenceClusters andmodelplane.ai/replica=trueon ModelReplicas — and matched on it. The cluster label was the worse of the two: a mandatory label with no semantic meaning that the platform team had to remember on every InferenceCluster, with no signal in the schema that it was required.crossplane/crossplane#7241 fixed the underlying issue in v2.2.1: a
ResourceSelectorwith onlyapiVersionandkindset now matches all resources of that kind. function-sdk-python v0.14.0 then letrequire_resourcesbuild such a selector when called with neither match field.This bumps the SDK to v0.14.0, drops both presence labels, and matches all InferenceClusters (when no
clusterSelectoris set) and all ModelReplicas by callingrequire_resourceswith no match field. The package declaresspec.crossplane.version: '>=v2.2.1'so it won't install on a Crossplane without the fix, and the CRD apiDependency moves from therelease-2.2branch to thev2.3.2tag.I have:
nix flake check(or./nix.sh flake check) and made sure it passes.git commit -s.