Skip to content

add getCondition and capabilities example#11

Merged
stevendborrelli merged 1 commit intocrossplane:mainfrom
stevendborrelli:new-0.5-sdk-features
Mar 6, 2026
Merged

add getCondition and capabilities example#11
stevendborrelli merged 1 commit intocrossplane:mainfrom
stevendborrelli:new-0.5-sdk-features

Conversation

@stevendborrelli
Copy link
Member

@stevendborrelli stevendborrelli commented Mar 6, 2026

Description of your changes

This PR adds examples demonstrating new v0.5.0 SDK features for capability detection and condition checking.

  • Added example code showing how to detect Crossplane capabilities using hasCapability()
  • Added example getting deployment condition using getCondition()
  • Imported new SDK functions: getObservedComposedResources, getCondition, hasCapability, Capability
  • Updated crossplane.yaml dependency version from >=v0.2.0 to >=v0.3.0

I have:

Signed-off-by: Steven Borrelli <steve@borrelli.org>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds example usage of new Crossplane Function SDK v0.5.0 helpers in the TypeScript function template, demonstrating capability detection and reading observed composed-resource conditions.

Changes:

  • Import and demonstrate hasCapability() / Capability to detect Crossplane feature support.
  • Import and demonstrate getObservedComposedResources() + getCondition() to read Deployment conditions from observed state.
  • Bump the configuration package dependency on ghcr.io/crossplane/function-template-typescript from >=v0.2.0 to >=v0.3.0.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/test-helpers.ts Removes a stray blank line (no behavioral change).
src/function.ts Adds SDK v0.5.0 example snippets for capability detection and observed condition checking.
package-configuration/crossplane.yaml Updates the referenced function package minimum version to >=v0.3.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@stevendborrelli stevendborrelli merged commit aea57f7 into crossplane:main Mar 6, 2026
13 checks passed
@stevendborrelli stevendborrelli deleted the new-0.5-sdk-features branch March 6, 2026 09:08
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.

2 participants