pkg/webhook/resourcesemantics
Matt Moore 16b36b7fca
Add support for admission webhook warnings. (#2498)
* Add support for admission webhook warnings.

This extends `apis.FieldError` to support designating certain FieldErrors as "warnings" (or explicitly as "errors", however, this is the default for back-compat).

You can turn an `apis.FieldError` into a warning using: `fe.At(apis.WarningLevel)` or force it into an error using: `fe.At(apis.ErrorLevel)`.

You can get the errors at a particular diagnostic level using: `fe.Filter(apis.WarningLevel)`.

This change also hooks this into the admission webhook infrastructure to support surfacing the "warning" level `apis.FieldError`s via the `Warnings` section of the `AdmissionResponse`.

Fixes: #2497

* Add a comment about the use of defer.
2022-05-02 21:56:57 +00:00
..
conversion Update actions (#2313) 2021-10-15 12:26:13 -07:00
defaulting Fix invalid creator or lastModifier annotations on core resources (#2409) 2022-01-31 06:49:30 -08:00
validation Add support for admission webhook warnings. (#2498) 2022-05-02 21:56:57 +00:00
interface.go Split the resource semantic webhooks into separate AdmissionControllers (#848) 2019-11-14 16:51:02 -08:00