func ValidatingWebhookFor(validator Validator, apiType runtime.Object) *admission.Webhook {
	return &admission.Webhook{
		Handler: &validatingHandler{
			apiType:   apiType,
			validator: validator,
		},
	}
}
ValidatingWebhookFor creates a new Webhook for validating the provided type.
package admission
import (
	"context"
	"net/http"
	"k8s.io/api/admission/v1beta1"
	"k8s.io/apimachinery/pkg/runtime"
	"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
type Validator interface {
	ValidateCreate(obj runtime.Object) error
	ValidateUpdate(obj runtime.Object, old runtime.Object) error
	ValidateDelete(obj runtime.Object) error
}