mirror of https://github.com/crossplane/docs.git
Remove docs on schema aware composition validation
Not relevant to functions. There's still some validation but it's common sense unconfigrable CEL stuff - not worth documenting. Signed-off-by: Nic Cope <nicc@rk0n.org>
This commit is contained in:
parent
9e8148807b
commit
9bfea3f5a5
|
@ -467,106 +467,6 @@ composite`.
|
|||
Composition.
|
||||
{{< /hint >}}
|
||||
|
||||
## Composition validation
|
||||
|
||||
When creating a Composition, Crossplane automatically validates its integrity,
|
||||
checking that the Composition is well formed, for example:
|
||||
|
||||
If using `mode: Resources`:
|
||||
|
||||
* The `resources` field isn't empty.
|
||||
* All resources either use a `name` or don't. Compositions can't use both named
|
||||
and unnamed resources.
|
||||
* No duplicate resource names.
|
||||
* Patch sets must have names.
|
||||
* Patches that require a `fromFieldPath` value provide it.
|
||||
* Patches that require a `toFieldPath` value provide it.
|
||||
* Patches that require a `combine` field provide it.
|
||||
* Readiness checks using `matchString` aren't empty.
|
||||
* Readiness checks using `matchInteger` isn't `0`.
|
||||
* Readiness checks requiring a `fieldPath` value provide it.
|
||||
|
||||
If using `mode: Pipeline` (Composition Functions):
|
||||
|
||||
* The `pipeline` field isn't empty.
|
||||
* No duplicate step names.
|
||||
|
||||
### Composition schema aware validation
|
||||
|
||||
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. Crossplane enables
|
||||
beta features by default.
|
||||
|
||||
Disable schema aware validation by setting the
|
||||
`--enable-composition-webhook-schema-validation=false` flag on the Crossplane
|
||||
pod.
|
||||
|
||||
The [Crossplane Pods]({{<ref "../guides/pods#edit-the-deployment">}}) page has
|
||||
more information on enabling Crossplane flags.
|
||||
{{< /hint >}}
|
||||
|
||||
#### Schema aware validation modes
|
||||
|
||||
Crossplane always rejects Compositions in case of integrity errors.
|
||||
|
||||
Set the schema aware validation mode to configure how Crossplane handles both
|
||||
missing resource schemas and schema aware validation errors.
|
||||
|
||||
{{<hint "note" >}}
|
||||
If a resource schema is missing, Crossplane skips schema aware validation
|
||||
but still returns an error for integrity errors and a warning or an error
|
||||
for the missing schemas.
|
||||
{{< /hint >}}
|
||||
|
||||
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 set the annotation value to
|
||||
{{<hover label="mode" line="5">}}loose{{</hover>}}.
|
||||
|
||||
```yaml {copy-lines="none",label="mode"}
|
||||
apiVersion: apiextensions.crossplane.io/v1
|
||||
kind: Composition
|
||||
metadata:
|
||||
annotations:
|
||||
crossplane.io/composition-schema-aware-validation-mode: loose
|
||||
# Removed for brevity
|
||||
spec:
|
||||
# Removed for brevity
|
||||
```
|
||||
|
||||
{{<hint "important" >}}
|
||||
Validation modes also apply to Compositions defined by Configuration packages.
|
||||
|
||||
Depending on the mode configured in the Composition, schema aware validation
|
||||
issues may result in warnings or the rejection of the Composition.
|
||||
|
||||
View the Crossplane logs for validation warnings.
|
||||
|
||||
Crossplane sets a Configuration as unhealthy if there are validation errors.
|
||||
View the Configuration details with `kubectl describe configuration` to see the
|
||||
specific errors.
|
||||
{{< /hint >}}
|
||||
|
||||
## Write a composition function
|
||||
|
||||
Composition functions let you replace complicated Compositions with code written
|
||||
|
|
Loading…
Reference in New Issue