From 9bfea3f5a5fa82b861d6b9f4b759ecc4c0d86840 Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Fri, 28 Mar 2025 22:54:17 -0700 Subject: [PATCH] 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 --- .../v2.0-preview/composition/compositions.md | 100 ------------------ 1 file changed, 100 deletions(-) diff --git a/content/v2.0-preview/composition/compositions.md b/content/v2.0-preview/composition/compositions.md index 1c30d498..4ab792ed 100644 --- a/content/v2.0-preview/composition/compositions.md +++ b/content/v2.0-preview/composition/compositions.md @@ -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. - -{{}} -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]({{}}) 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. - -{{}} -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 -{{}}crossplane.io/composition-schema-aware-validation-mode{{}} -annotation. - -If not specified, the default mode is `warn`. - -For example, to enable `loose` mode checking set the annotation value to -{{}}loose{{}}. - -```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 -``` - -{{}} -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