This document specifies a new user experience for Crossplane composition functions in Python. The goal is to provide a declarative, type-safe API that feels similar to Pulumi/Terraform while hiding protobuf complexity entirely.
GitHub Issue: crossplane/crossplane#6766
Current Problem: Crossplane's package manager makes incremental changes without validating complete operations upfront, leading to:
- No pre-flight validation of dependency resolution
- CRD/MRD conflicts discovered too late
- Risky complex operations with no guarantee of success
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
| package main | |
| import ( | |
| "bytes" | |
| "flag" | |
| "fmt" | |
| "io/fs" | |
| "log" | |
| "os" | |
| "path/filepath" |
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
| apiVersion: apiextensions.crossplane.io/v1alpha1 | |
| kind: FunctionIO | |
| # Optional arbitrary KRM-like resource. Each function in a pipeline will be | |
| # called with its own function config (i.e. config is not pipelined). | |
| config: | |
| apiVersion: database.example.org/v1alpha1 | |
| kind: Config | |
| metadata: | |
| name: cloudsql | |
| spec: |
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
| --- | |
| apiVersion: apiextensions.crossplane.io/v1 | |
| kind: Composition | |
| metadata: | |
| name: leaktest | |
| spec: | |
| writeConnectionSecretsToNamespace: crossplane-system | |
| compositeTypeRef: | |
| apiVersion: crossplane.io/v1alpha1 | |
| kind: LeakTest |
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
| 00:11:48 [34m[ .. ][0m verify dependencies have expected content | |
| all modules verified | |
| 00:11:50 [32m[ OK ][0m go modules dependencies verified | |
| 00:11:50 [34m[ .. ][0m go test unit-tests | |
| ? github.com/crossplane/conformance/internal [no test files] | |
| === RUN TestCompositeResourceDefinition | |
| apiextensions_test.go:62: Created XRD "clusterconformances.test.crossplane.io" | |
| === RUN TestCompositeResourceDefinition/BecomesEstablishedAndOffered | |
| === PAUSE TestCompositeResourceDefinition/BecomesEstablishedAndOffered | |
| === RUN TestCompositeResourceDefinition/CRDIsCreatedForXR |
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
| - base: | |
| apiVersion: identity.aws.crossplane.io/v1alpha1 | |
| kind: IAMPolicy | |
| spec: | |
| forProvider: | |
| description: "policy to access dynamodb table." | |
| patches: | |
| - type: PatchSet | |
| patchSetName: Metadata | |
| - fromFieldPath: "metadata.name" |
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
| --- | |
| apiVersion: apiextensions.crossplane.io/v1alpha1 | |
| kind: InfrastructureDefinition | |
| metadata: | |
| name: wordpressinstances.apps.example.org | |
| spec: | |
| crdSpecTemplate: | |
| group: apps.example.org | |
| version: v1alpha1 | |
| names: |
This file has been truncated, but you can view the full file.
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
| { | |
| "format_version": "0.1", | |
| "provider_schemas": { | |
| "aws": { | |
| "provider": { | |
| "version": 0, | |
| "block": { | |
| "attributes": { | |
| "access_key": { | |
| "type": "string", |
NewerOlder