Skip to content

Commit

Permalink
fix tidb defaulting (pingcap#1865)
Browse files Browse the repository at this point in the history
Co-authored-by: Song Gao <disxiaofei@163.com>
  • Loading branch information
cofyc and Yisaer authored Mar 5, 2020
1 parent 36af5ba commit 0d11094
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/apis/pingcap/v1alpha1/defaulting/tidbcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ func setTidbClusterSpecDefault(tc *v1alpha1.TidbCluster) {
}

func setTidbSpecDefault(tc *v1alpha1.TidbCluster) {
if tc.Spec.TiDB.BaseImage == "" {
tc.Spec.TiDB.BaseImage = defaultTiDBImage
if tc.Spec.TiDB.Config == nil {
tc.Spec.TiDB.Config = &v1alpha1.TiDBConfig{}
}
if len(tc.Spec.Version) > 0 || tc.Spec.TiDB.Version != nil {
if tc.Spec.TiDB.Config == nil {
tc.Spec.TiDB.Config = &v1alpha1.TiDBConfig{}
if tc.Spec.TiDB.BaseImage == "" {
tc.Spec.TiDB.BaseImage = defaultTiDBImage
}
}
}
Expand Down

0 comments on commit 0d11094

Please sign in to comment.