Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Borrelli <[email protected]>
  • Loading branch information
stevendborrelli committed Nov 25, 2024
1 parent 54705fe commit 56034b6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,47 @@ spec:

For more information, see the example in [recursive](example/recursive).

## Setting Conditions on the Claim and Composite

Starting with Crossplane 1.17, Composition authors can set custom Conditions on the
Composite and the Claim.

Add a `ClaimConditions` to your template to set Conditions:

```yaml
apiVersion: meta.gotemplating.fn.crossplane.io/v1alpha1
kind: ClaimConditions
conditions:
# Guide to ClaimConditions fields:
# Type of the condition, e.g. DatabaseReady.
# 'Healthy', 'Ready' and 'Synced' are reserved for use by Crossplane and this function will raise an error if used
# - type:
# Status of the condition. String of "True"/"False"/"Unknown"
# status:
# Machine-readable PascalCase reason, for example "ErrorProvisioning"
# reason:
# Optional Target. Publish Condition only to the Composite, or the Composite and the Claim (CompositeAndClaim).
# Defaults to Composite
# target:
# Optional message:
# message:
- type: TestCondition
status: "False"
reason: InstallFail
message: "failed to install"
target: CompositeAndClaim
- type: ConditionTrue
status: "True"
reason: TrueCondition
message: we are true
target: Composite
- type: DatabaseReady
status: "True"
reason: Ready
message: Database is ready
target: CompositeAndClaim
```

## Additional functions

| Name | Description |
Expand Down
5 changes: 3 additions & 2 deletions example/conditions/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
# - type:
# Status of the condition. String of "True"/"False"/"Unknown"
# status:
# Machine-readable PascalCase reason, for example "DatabaseReady"
# Machine-readable PascalCase reason, for example "ErrorProvisioning"
# reason:
# Optional Target. Publish Condition only to the Composite, or the Composite and the Claim (CompositeAndClaim).
# Defaults to Composite
Expand All @@ -41,13 +41,14 @@ spec:
target: CompositeAndClaim
- type: ConditionTrue
status: "True"
reason: this condition is true
reason: TrueCondition
message: we are true
target: Composite
- type: DatabaseReady
status: "True"
reason: Ready
message: Database is ready
target: CompositeAndClaim
- step: automatically-detect-ready-composed-resources
functionRef:
name: crossplane-contrib-function-auto-ready

0 comments on commit 56034b6

Please sign in to comment.