Skip to content

docs(cli): add a Rust tab to the projects get-started guide - #1156

Draft
jonasz-lasut wants to merge 1 commit into
crossplane:masterfrom
jonasz-lasut:rust-tab
Draft

jonasz-lasut wants to merge 1 commit into
crossplane:masterfrom
jonasz-lasut:rust-tab

Conversation

@jonasz-lasut

@jonasz-lasut jonasz-lasut commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Document writing composition functions in Rust alongside the existing Templated YAML, Python, Go and KCL tabs. The tab follows the Go one and covers the parts that differ:

  • Models come from the crossplane-models crate the CLI generates into schemas/rust, Kubernetes built-ins included, so Deployment and Service are imported from it. The scaffolded function depends on the crate by path.
  • Each API group and version is a module named after the reversed group, which is why the XR is crossplane_models::com::example::platform::v1alpha1::WebApp.
  • Every field of a generated model is an Option that is left out when unset, and Default fills in a resource's apiVersion and kind. That is why the example ends each struct with ..Default::default().

The example renders to exactly the output the page already shows under "Render the composition". I checked that by running the guide's steps with a CLI built from the Rust support branch and comparing the rendered YAML with the page's.

Also note the render timeout. composition render defaults to 1m, and the CLI compiles a Rust function and its dependencies from source on every render, which overruns it and fails with "context deadline exceeded".

Add crates.io to the Vale brand list so the content lints clean.

Depends on crossplane/cli#374

@netlify

netlify Bot commented Sep 17, 2026

Copy link
Copy Markdown

Deploy Preview for crossplane ready!

Name Link
🔨 Latest commit 6a0a5e7
🔍 Latest deploy log https://app.netlify.com/projects/crossplane/deploys/6aabbeaae32e5600083ef80e
😎 Deploy Preview https://deploy-preview-1156--crossplane.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 93 (🔴 down 2 from production)
Accessibility: 90 (🔴 down 2 from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Document writing the get-started composition function in Rust, next
to the Templated YAML, Python, Go and KCL tabs. The example builds the
Deployment and the Service from the models the CLI generates into the
crossplane-models crate, and renders to the output the page already
shows.

Note that render needs a longer timeout with a Rust function: the CLI
compiles the function and its dependencies from source on every
render, which overruns the default of one minute.

Add crates.io to the Vale brand list so the page lints clean.

Signed-off-by: Jonasz Łasut-Balcerzak <jonasz@upbound.io>
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