func (r *HttpsCert) ValidateUpdate(old runtime.Object) error {
	httpscertlog.Info("validate update", "name", r.Name)
	return r.validate()
}
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
package v1alpha1
import (
	"fmt"
	"strings"
	"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 httpscertlog = logf.Log.WithName("httpscert-resource")
func (r *HttpsCert) SetupWebhookWithManager(mgr ctrl.Manager) error {
	return ctrl.NewWebhookManagedBy(mgr).
		For(r).
		Complete()
}
var _ webhook.Defaulter = &HttpsCert{}
func (r *HttpsCert) Default() {
	var processedDomains []string
	uniqDomainMap := make(map[string]interface{})
	for _, domain := range r.Spec.Domains {
		domain = strings.TrimSpace(domain)
		if len(domain) <= 0 {
			continue
		}
		uniqDomainMap[domain] = true
	}
	for domain := range uniqDomainMap {
		processedDomains = append(processedDomains, domain)
	}
	r.Spec.Domains = processedDomains
}
var _ webhook.Validator = &HttpsCert{}
func (r *HttpsCert) ValidateCreate() error {
	httpscertlog.Info("validate create", "name", r.Name)
	if err := r.validate(); err != nil {
		return err
	}
	return nil
}