func (r *TestClusterTopology) ValidateUpdate(old runtime.Object) error {
	testclustertopologylog.Info("validate update", "name", r.Name)
	tct := old.(*TestClusterTopology)
	switch {
	case r.Spec.TiDBCluster != nil:
		return r.validateTiDBUpdate(tct)
	case r.Spec.FlinkCluster != nil:
	case r.Spec.DMCluster != nil:
	}
	return nil
}
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
package v1
import (
	"fmt"
	"reflect"
	"strconv"
	"strings"
	"github.com/r3labs/diff"
	"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 testclustertopologylog = logf.Log.WithName("testclustertopology-resource")
func (r *TestClusterTopology) SetupWebhookWithManager(mgr ctrl.Manager) error {
	return ctrl.NewWebhookManagedBy(mgr).
		For(r).
		Complete()
}
const (
	ControlField      = "Control"
	ConfigField       = "Config"
	VersionField      = "Version"
	GlobalField       = "Global"
	TiDBField         = "TiDB"
	TiKVField         = "TiKV"
	PDField           = "PD"
	PumpField         = "Pump"
	DrainerField      = "Drainer"
	MonitorField      = "Monitor"
	GrafanaField      = "Grafana"
	MasterField       = "Master"
	WorkerField       = "Worker"
	AlertManagerField = "AlertManager"
	TiFlashField      = "TiFlash"
	CDCField          = "CDC"
)
var _ webhook.Defaulter = &TestClusterTopology{}
func (r *TestClusterTopology) Default() {
	testclustertopologylog.Info("default", "name", r.Name)
}
var _ webhook.Validator = &TestClusterTopology{}
func (r *TestClusterTopology) ValidateCreate() error {
	testclustertopologylog.Info("validate create", "name", r.Name)
	clusterNum := countClusterNum(r)
	if clusterNum > 1 {
		return fmt.Errorf("only one cluster can be created at a time")
	}
	switch {
	case r.Spec.TiDBCluster != nil:
		result := getEmptyRequiredFields(r.Spec.TiDBCluster)
		if len(result) != 0 {
			return fmt.Errorf("you must fill %v", result)
		}
	case r.Spec.FlinkCluster != nil:
	case r.Spec.DMCluster != nil:
	}
	return nil
}