func (tcc *defaultTikvClusterControl) UpdateTikvCluster(tc *v1alpha1.TikvCluster) error {
	tcc.defaulting(tc)
	if !tcc.validate(tc) {
		return nil  
	}
	var errs []error
	oldStatus := tc.Status.DeepCopy()
	if err := tcc.updateTikvCluster(tc); err != nil {
		errs = append(errs, err)
	}
	if err := tcc.conditionUpdater.Update(tc); err != nil {
		errs = append(errs, err)
	}
	if apiequality.Semantic.DeepEqual(&tc.Status, oldStatus) {
		return errorutils.NewAggregate(errs)
	}
	if _, err := tcc.tcControl.UpdateTikvCluster(tc.DeepCopy(), &tc.Status, oldStatus); err != nil {
		errs = append(errs, err)
	}
	return errorutils.NewAggregate(errs)
}
UpdateStatefulSet executes the core logic loop for a tikvcluster.
package tikvcluster
import (
	"github.com/tikv/tikv-operator/pkg/apis/tikv/v1alpha1"
	"github.com/tikv/tikv-operator/pkg/apis/tikv/v1alpha1/defaulting"
	v1alpha1validation "github.com/tikv/tikv-operator/pkg/apis/tikv/v1alpha1/validation"
	"github.com/tikv/tikv-operator/pkg/controller"
	"github.com/tikv/tikv-operator/pkg/manager"
	"github.com/tikv/tikv-operator/pkg/manager/member"
	v1 "k8s.io/api/core/v1"
	apiequality "k8s.io/apimachinery/pkg/api/equality"
	errorutils "k8s.io/apimachinery/pkg/util/errors"
	"k8s.io/client-go/tools/record"
	"k8s.io/klog"
)
type ControlInterface interface {
	UpdateTikvCluster(*v1alpha1.TikvCluster) error
}
func NewDefaultTikvClusterControl(
	tcControl controller.TikvClusterControlInterface,
	pdMemberManager manager.Manager,
	tikvMemberManager manager.Manager,
	metaManager manager.Manager,
	orphanPodsCleaner member.OrphanPodsCleaner,
	discoveryManager member.PDDiscoveryManager,
	conditionUpdater TikvClusterConditionUpdater,
	recorder record.EventRecorder) ControlInterface {
	return &defaultTikvClusterControl{
		tcControl,
		pdMemberManager,
		tikvMemberManager,
		metaManager,
		orphanPodsCleaner,
		discoveryManager,
		conditionUpdater,
		recorder,
	}
}
type defaultTikvClusterControl struct {
	tcControl         controller.TikvClusterControlInterface
	pdMemberManager   manager.Manager
	tikvMemberManager manager.Manager
	metaManager       manager.Manager
	orphanPodsCleaner member.OrphanPodsCleaner
	discoveryManager  member.PDDiscoveryManager
	conditionUpdater  TikvClusterConditionUpdater
	recorder          record.EventRecorder
}