func (r *TestResourceRequest) ValidateCreate() error {
	testresourcerequestlog.Info("validate create", "name", r.Name)
	for _, resourceSpec := range r.Spec.Items {
		if err := resourceSpec.Spec.ValidateCreate(); err != nil {
			return err
		}
	}
	err := r.checkItems()
	return err
}
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
package v1
import (
	"fmt"
	"k8s.io/apimachinery/pkg/runtime"
	ctrl "sigs.k8s.io/controller-runtime"
	logf "sigs.k8s.io/controller-runtime/pkg/log"
	"sigs.k8s.io/controller-runtime/pkg/webhook"
)
var testresourcerequestlog = logf.Log.WithName("testresourcerequest-resource")
func (r *TestResourceRequest) SetupWebhookWithManager(mgr ctrl.Manager) error {
	return ctrl.NewWebhookManagedBy(mgr).
		For(r).
		Complete()
}
var _ webhook.Defaulter = &TestResourceRequest{}
func (r *TestResourceRequest) Default() {
	testresourcerequestlog.Info("default", "name", r.Name)
}
var _ webhook.Validator = &TestResourceRequest{}