func (tcc *defaultTikvClusterControl) UpdateTikvCluster(tc *v1alpha1.TikvCluster) error {
	tcc.defaulting(tc)
	if !tcc.validate(tc) {
		return nil // fatal error, no need to retry on invalid object
	}

	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.
UpdateStatefulSet executes the core logic loop for a tikvcluster.
// UpdateStatefulSet executes the core logic loop for a tikvcluster .
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)
}
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.
UpdateStatefulSet executes the core logic loop for a tikvcluster .
// fatal error, no need to retry on invalid object