Repository navigation
Conversation
… API Rewrite the composition function and tests from KCL to Python, split into core.py, which builds the composed resources and status without talking to Crossplane, and a thin fn.py, with pytest unit tests on core.py. Serialize with by_alias and exclude_none rather than passing models to resource.update(). Apply the layered composition guidance: the Cluster schema describes intent and changes additively only. - Add nodes.size (small, medium, large), mapped to a machine type in the function; nodes.instanceType remains as an explicit override. - Move the operator chart-version defaults out of the XRD into the function, so they follow platform updates; operators.*.version remain as overrides. - Publish status for consumers: network ID, the ProviderConfig Apps deploy with, the kubeconfig Secret and per-part readiness. - Add XRD categories and a description. Fix composition bugs: - Name composed resources after the Cluster so Clusters can share a namespace; existing resources keep their names. - Protect Apps through the App API, one Usage per App on this cluster, instead of a helm.crossplane.io Release selector that never matched. - Map deletionPolicy: Orphan to the Oss API's accepted policies. - Only compose the Oss and Flux Usages alongside Oss and Flux. - Drop v1-era fields with no effect on namespaced XRs. Fix the examples and README for Crossplane v2: namespaced ProviderConfigs, the database connection Secret name, the postgres network ID, and no claims. Co-Authored-By: Claude Opus 5.5 <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
Rewrite the
Clustercomposition function and tests from KCL to Python, and reshape theClusterinto a stable platform API following Javid Habibi's "Can Your Platform API Survive Its Own Implementation?". The XRD changes are additive only, and existing Clusters keep their composed resources.Python, split like the other Python functions
function/core.pybuilds the composed resources and status as typed models, without talking to Crossplane.function/fn.pyonly handles the request, andfunction/serialize.pydumps withby_aliasandexclude_none(passing models straight toresource.update()drops aliases and defaults).functions/cluster/testscover what composition tests can't, mainly that a resource is not composed (nothing in-cluster before GKE is ready, no Usage for an App on another cluster). The shared workflow change that runs them in CI is upbound/sa-up#599.The Cluster as a platform API
nodes.size(small,medium,large) maps to a machine type in the function;mediumis the old defaultn1-standard-4.nodes.instanceTypestays as a documented override.operators.*.versionstays as an override.Fixes
helm.crossplane.ioReleases, butconfiguration-appcreates namespacedhelm.m.crossplane.ioones, so it never matched and was forced Ready. Apps are now found through the App API, one Usage per App on this cluster.deletionPolicy: Orphanproduced anOsswithLateInitialize, which the Oss API rejects; it now uses Oss's documented orphan policies.writeConnectionSecretsToNamespace,defaultCompositeDeletePolicy).gcp.m.upbound.ioProviderConfigs, the database connection Secret name, the postgres network ID, no claims.Upgrading existing Clusters
<id>-gke-by-labeled-release) is removed; it never protected anything.providerConfigNameis the Cluster'sid, and that carry theplatform.upbound.io/deletion-ordering: enabledlabel, are protected.gcp.platformref.upbound.io/cluster-idlabel.Testing
up project build, 5 composition tests and 14 unit tests pass; a deliberately broken gate makes a unit test fail.Follow-up
The domain packages are moving to provider-gcp v3 with typed status and an optional
networkRef: upbound/configuration-gcp-network#91, upbound/configuration-gcp-gke#103, upbound/configuration-gcp-database#96. Once they're released, this repo bumps to them, which also resolves today's provider-family version conflict, and wires GKE to its Network by status.🤖 Generated with Claude Code