Skip to content

Commit

Permalink
chore: review
Browse files Browse the repository at this point in the history
Co-authored-by: Pete Lumbis <pete@upbound.io>
  • Loading branch information
phisco and plumbis authored Oct 27, 2023
1 parent a41a192 commit f44dc9f
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions content/master/concepts/compositions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1310,18 +1310,20 @@ checking that the Composition is well formed, for example:

### Composition schema aware validation

On top of the preceding integrity checks, Crossplane performs schema aware
validation of Compositions, checking that `patches`, `readinessChecks` and
`connectionDetails` are valid according to the involved resources' schemas, for
example checking that the source/destination field of a patch is a valid field
according to the source/destination resource's schema and that types match, if
defined, taking into account transforms.
Crossplane also performs schema aware
validation of Compositions. Schema validation checks that `patches`,
`readinessChecks` and `connectionDetails` are valid according to the resource
schemas. For example, checking that the source and destination fields of a patch
are valid according to the source and destination resource schema.

{{<hint "note" >}}
Composition schema aware validation is a beta feature, so Crossplane
enables it by default. You can disable it by setting the
Composition schema aware validation is a beta feature. Crossplane enables
beta features by default.

Disable schema aware validation by setting the
`--enable-composition-webhook-schema-validation=false` flag on the Crossplane
pod.
pod.

The [Crossplane Pods]({{<ref "./pods#edit-the-deployment">}}) page has
more information on enabling Crossplane flags.
{{< /hint >}}
Expand All @@ -1340,19 +1342,22 @@ validation altogether.

The following modes are available:

{{< table "table table-sm table-striped" >}}
| Mode | Missing Schema | Schema Aware Error | Integrity Error |
| -------- | -------------- |--------------------|-----------------|
| `warn` | Warning | Warning | Error |
| `loose` | Warning | Error | Error |
| `strict` | Error | Error | Error |
{{< /table >}}

Change the validation mode for a Composition with the
{{<hover label="mode" line="5">}}crossplane.io/composition-schema-aware-validation-mode{{</hover>}}
annotation.

If not specified, the default mode is `warn`.

For example, to enable `loose` mode checking:
For example, to enable `loose` mode checking set the annotation value to
{{<hover label="mode" line="5">}}loose{{</hover>}}.

```yaml {copy-lines="none",label="mode"}
apiVersion: apiextensions.crossplane.io/v1
Expand Down

0 comments on commit f44dc9f

Please sign in to comment.