@@ -467,106 +467,6 @@ composite`.
467
467
Composition.
468
468
{{< /hint >}}
469
469
470
- # # Composition validation
471
-
472
- When creating a Composition, Crossplane automatically validates its integrity,
473
- checking that the Composition is well formed, for example :
474
-
475
- If using `mode : Resources`:
476
-
477
- * The `resources` field isn't empty.
478
- * All resources either use a `name` or don't. Compositions can't use both named
479
- and unnamed resources.
480
- * No duplicate resource names.
481
- * Patch sets must have names.
482
- * Patches that require a `fromFieldPath` value provide it.
483
- * Patches that require a `toFieldPath` value provide it.
484
- * Patches that require a `combine` field provide it.
485
- * Readiness checks using `matchString` aren't empty.
486
- * Readiness checks using `matchInteger` isn't `0`.
487
- * Readiness checks requiring a `fieldPath` value provide it.
488
-
489
- If using `mode : Pipeline` (Composition Functions):
490
-
491
- * The `pipeline` field isn't empty.
492
- * No duplicate step names.
493
-
494
- # ## Composition schema aware validation
495
-
496
- Crossplane also performs schema aware
497
- validation of Compositions. Schema validation checks that `patches`,
498
- ` readinessChecks` and `connectionDetails` are valid according to the resource
499
- schemas. For example, checking that the source and destination fields of a patch
500
- are valid according to the source and destination resource schema.
501
-
502
- {{<hint "note" >}}
503
- Composition schema aware validation is a beta feature. Crossplane enables
504
- beta features by default.
505
-
506
- Disable schema aware validation by setting the
507
- ` --enable-composition-webhook-schema-validation=false` flag on the Crossplane
508
- pod.
509
-
510
- The [Crossplane Pods]({{<ref "../guides/pods#edit-the-deployment">}}) page has
511
- more information on enabling Crossplane flags.
512
- {{< /hint >}}
513
-
514
- # ### Schema aware validation modes
515
-
516
- Crossplane always rejects Compositions in case of integrity errors.
517
-
518
- Set the schema aware validation mode to configure how Crossplane handles both
519
- missing resource schemas and schema aware validation errors.
520
-
521
- {{<hint "note" >}}
522
- If a resource schema is missing, Crossplane skips schema aware validation
523
- but still returns an error for integrity errors and a warning or an error
524
- for the missing schemas.
525
- {{< /hint >}}
526
-
527
- The following modes are available :
528
-
529
- {{< table "table table-sm table-striped" >}}
530
- | Mode | Missing Schema | Schema Aware Error | Integrity Error |
531
- | -------- | -------------- |--------------------|-----------------|
532
- | `warn` | Warning | Warning | Error |
533
- | `loose` | Warning | Error | Error |
534
- | `strict` | Error | Error | Error |
535
- {{< /table >}}
536
-
537
- Change the validation mode for a Composition with the
538
- {{<hover label="mode" line="5">}}crossplane.io/composition-schema-aware-validation-mode{{</hover>}}
539
- annotation.
540
-
541
- If not specified, the default mode is `warn`.
542
-
543
- For example, to enable `loose` mode checking set the annotation value to
544
- {{<hover label="mode" line="5">}}loose{{</hover>}}.
545
-
546
- ` ` ` yaml {copy-lines="none",label="mode"}
547
- apiVersion: apiextensions.crossplane.io/v1
548
- kind: Composition
549
- metadata:
550
- annotations:
551
- crossplane.io/composition-schema-aware-validation-mode: loose
552
- # Removed for brevity
553
- spec:
554
- # Removed for brevity
555
- ` ` `
556
-
557
- {{<hint "important" >}}
558
- Validation modes also apply to Compositions defined by Configuration packages.
559
-
560
- Depending on the mode configured in the Composition, schema aware validation
561
- issues may result in warnings or the rejection of the Composition.
562
-
563
- View the Crossplane logs for validation warnings.
564
-
565
- Crossplane sets a Configuration as unhealthy if there are validation errors.
566
- View the Configuration details with `kubectl describe configuration` to see the
567
- specific errors.
568
- {{< /hint >}}
569
-
570
470
# # Write a composition function
571
471
572
472
Composition functions let you replace complicated Compositions with code written
0 commit comments