Skip to content

Commit

Permalink
move defaulting
Browse files Browse the repository at this point in the history
  • Loading branch information
Song Gao committed Mar 24, 2020
1 parent bf58df1 commit 9779b17
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/controller/tidbcluster/tidb_cluster_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type defaultTidbClusterControl struct {

// UpdateStatefulSet executes the core logic loop for a tidbcluster.
func (tcc *defaultTidbClusterControl) UpdateTidbCluster(tc *v1alpha1.TidbCluster) error {
tcc.defaulting(tc)
if !tcc.validate(tc) {
return nil // fatal error, no need to retry on invalid object
}
Expand Down Expand Up @@ -114,9 +115,11 @@ func (tcc *defaultTidbClusterControl) validate(tc *v1alpha1.TidbCluster) bool {
return true
}

func (tcc *defaultTidbClusterControl) updateTidbCluster(tc *v1alpha1.TidbCluster) error {
// default the tidbcluster
func (tcc *defaultTidbClusterControl) defaulting(tc *v1alpha1.TidbCluster) {
defaulting.SetTidbClusterDefault(tc)
}

func (tcc *defaultTidbClusterControl) updateTidbCluster(tc *v1alpha1.TidbCluster) error {
// syncing all PVs managed by operator's reclaim policy to Retain
if err := tcc.reclaimPolicyManager.Sync(tc); err != nil {
return err
Expand Down

0 comments on commit 9779b17

Please sign in to comment.