mirror of https://github.com/knative/pkg.git
* 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. |
||
---|---|---|
.. | ||
factory.go | ||
listers.go | ||
testing.go |