pkg/testing
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
..
duck Update actions (#2313) 2021-10-15 12:26:13 -07:00
doc.go Move the test resource out of `./webhook`. (#32) 2018-07-31 16:02:37 -07:00
inner_default_resource.go Add support for admission webhook warnings. (#2498) 2022-05-02 21:56:57 +00:00
inner_default_resource_test.go v2 (#1754) 2020-09-29 13:18:29 -07:00
register.go Fix revive related linting issues (#2131) 2021-05-26 01:10:28 -07:00
resource.go Allow Unstructured callback from Defaulting Webhook (#2363) 2022-01-14 06:18:42 -08:00
zz_generated.deepcopy.go Update actions (#2313) 2021-10-15 12:26:13 -07:00