Validator defines interface for a validation webHook
| 9 | |
| 10 | // Validator defines interface for a validation webHook |
| 11 | type Validator interface { |
| 12 | // Prototype returns a prototype of Object for this admission request. |
| 13 | Prototype(req admission.Request) (runtime.Object, error) |
| 14 | |
| 15 | // ValidateCreate handles Object creation and returns error if any. |
| 16 | ValidateCreate(ctx context.Context, obj runtime.Object) error |
| 17 | // ValidateUpdate handles Object update and returns error if any. |
| 18 | ValidateUpdate(ctx context.Context, obj runtime.Object, oldObj runtime.Object) error |
| 19 | // ValidateDelete handles Object deletion and returns error if any. |
| 20 | ValidateDelete(ctx context.Context, obj runtime.Object) error |
| 21 | } |
| 22 | |
| 23 | // ValidatingWebhookForValidator creates a new validating Webhook. |
| 24 | func ValidatingWebhookForValidator(validator Validator, scheme *runtime.Scheme) *admission.Webhook { |
no outgoing calls
no test coverage detected